Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pass Through Problem
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01063586
Message ID:
01063590
Views:
7
The datetime values should be sent as strings. If you want to make your life easier,use either textmerge or SPT parameters.

>I'm trying to form an INSERT INTO string and run it:
>
>
>sSqlCommand = "insert into syserrors "+;
>  "(datetime, error, line, message, codeline, program," +;
>  "user, appname, memory, status, callstack, notified)"+;
>  " values "+;
>  "("+ sDateTime + "," +;
>  sErrNo + "," +;
>  sLineNo + "," +;
>  "'" + sErrMessage + "' ," +;
>  "'" + sLineOfCode + "' ," +;
>  "'" + sProgram + "' ," +;
>  "'" + sUserId + "' ," +;
>  "'" + sAppName + "' ," +;
>  "'" + sMemory + "' ," +;
>  "'" + sStatus + "' ," +;
>  "'" + sStack + "' ," +;
>"0)"
>
>
>After running this the string looks like:
>
>

>insert into syserrors (datetime, error, line, message, codeline, program, user, appname,
>memory, status, callstack, notified)
>values
>(10/31/2005 07:40:27,1000,5000,'TEST MESSAGE' ,'TEST CODE LINE' ,'TEST PROGRAM' ,'KMAROIS'
>,'TEST' ,'' ,'' ,'TEST STACK' ,0)
>

>
>
>SQL Server is returning the error "Incorrect syntax near '07'.
>
>Notice the DateTime value. It seems to be appearing as a string. Anyone know how
>to solve this?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform