> exec sp_InsertVehicleData;1 '2009/01/17
> 15:48:12',1,'0358104000636686','00000F611B8C',17,$53.5161,$-2.2367,0
> ,$15475.
> 5996,$0.0000,$0.0000,0,0,'S',0,0,0,0,0,0,0,0,'',$-2.2367,$53.5161,$6
> 5535.000
> 0,0x010358104000636686FF447800344015FF2A00000F611B8C11EAC5738C791056
> 42C0260F
> C00008B90400000000C0260FC07910564200FF7F47900105,60,1,'447800344015'

So you're collecting moving vehicle GPS data from a UK mobile telephone
modem for a map, seen it all before <g>

> So, you solution would be something like creating a string:

Essentially yes, except ADO adds sp_ and ;1 so just use the stored
procedure name:

exec InsertVehicleData xxx 

And you've got a wide range of data types in your parameter list there,
which you need to ensure match the data types in the stored procedure,
those hex strings look strange, but then I don't store binary stuff.
You're original error could be in those strings.  You might be better
passing strange numbers as VARCHAR and converting them to numerics in the
stored procedure itself, assuming you can mess with it. 

Getting back on topic with ICS, this is how I build the parameter to save
my FTP server statistics in SQL:

    cmd := 'EXEC ftp_events_updx1 ' +
        IntToStr (FtpServers [servnr].StartId) + paramSep +
        QuotedStr (EventState) + paramSep +
        QuotedStr (Comment) + paramSep +
        '0' + paramSep +          // endpos
        IntToStr (FtpServers [servnr].TotalXmit) + paramSep +
        IntToStr (FtpServers [servnr].TotalRecv) + paramSep +
        IntToStr (secs) + paramSep +          // duration secs
        IntToStr (FtpServers [servnr].MaxSpeedXmit) + paramSep +
        IntToStr (FtpServers [servnr].MaxSpeedRecv) ;
    ExecSqlFtpCmd (cmd) ;

and this is the core of the function to call SQL and get a resultset,
which just contains two fields with an error code and description in this
case, but could be a million records.

DataSetFtpUpd.Recordset := ADOConn.Execute (cmd) ;
if DataSetFtpUpd.RecordCount = 1 then
begin
   dbretcode := DataSetFtpUpd.Fields[0].DisplayText ;
   result := AscToInt (DataSetFtpUpd.Fields[2].DisplayText) ;
end ;
  
Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to