Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Pass Through Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL Pass Through Problem
Divers
Thread ID:
01063586
Message ID:
01063586
Vues:
37
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?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform