Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and SQL SERVER 6.5
Message
From
07/11/1997 08:39:56
 
 
To
06/11/1997 23:51:27
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00058808
Message ID:
00058842
Views:
33
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform