Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL INSERT FAILURE FROM VFP50! Help!
Message
From
06/11/1997 23:51:41
John Baird
Coatesville, Pennsylvania, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
SQL INSERT FAILURE FROM VFP50! Help!
Miscellaneous
Thread ID:
00058811
Message ID:
00058811
Views:
68
Once again I'm pulling out my hair. I got the previous sql problem solved by using ' instead of ". Now, the following snippet won't insert the record into SQL Server. If I use the following lcSQL with the expanded values in the statement, from ISQL-w it works just fine, from my program it returns -1. Help! Do I need to DBSet some property? I am not using a view but inserting directly into the table. ***************************************************************************** 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)
Reply
Map
View

Click here to load this message in the networking platform