Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and SQL SERVER 6.5
Message
De
07/11/1997 08:39:56
 
 
À
06/11/1997 23:51:27
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00058808
Message ID:
00058842
Vues:
38
>Well, you all solved the last dilemma that kept me pulling what little bit of hair I have left out. Here's another one for the SQL guru's
>
>This is just like the previous one. The lcSQL statement works (the insert takes place) just fine in ISQL-w but fails in VFP (lcErrorCode)
>is -1. Do I need the DBSET some property? Thanks in advance.
>
>
>
>STORE SQLCONNECT('MyDataBase', 'sa') TO gnConnHandle
>IF gnConnHandle <= 0
> RETURN
>ENDIF
>lcLoginID='john'
>lnSessionID = VAL(RIGHT(SYS(3) + SYS(3),10))
>lnStudentID = 26
>lcRemoteAddress = '177.100.100.98'
>lcSQL = [INSERT INTO Sessions (SessionID, LoginID, LoginDate, UserType, UserID, ] +;
> [CdromDrive, IPAddress, CurrentCourse, Comment) VALUES (] + ;
> ALLTRIM(STR(lnSessionID)) + [, '] + lcLoginId +[', '] + TTOC(DTOT(DATE())) +;
> [', 'STUDENT', '] + ALLTRIM(STR(lnStudentId)) + [', 'None', '] + lcRemoteAddress + [', ' ', ' ')]
>lcErrorCode = SQLEXEC(gnConnHandle, lcSql)

If would be easier if you supplied the error that was returned by MESSAGE() but I thinnk that you're missing quotes around the ALLTRIM(STR(lnSessionId))

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform