Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting records to SQL Server
Message
From
30/10/2001 19:51:07
 
 
To
29/10/2001 17:38:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00574760
Message ID:
00575414
Views:
26
Crescencio, I tried the code that you sent me.


Here is the code:

************************************************************************
*-- jeinterface is a VFP table with a field called
*-- batch_skey wich is character type.
IF !USED('jeinterface')
USE jeinterface IN 0
SELECT jeinterface
ELSE
SELECT jeinterface
ENDIF
GO TOP
*-- Create connection to SQL server
nHan = SqlConnect("jeinterface")
IF ( nHan = -1 )
WAIT WINDOW 'failure of Connect'
ENDIF

SCAN
lcBatchSkey =jeinterface.batch_skey
nRes = SQLExec(nHan, "INSERT INTO jeinterface (batch_skey);
Values('THIS IS A TEST') ")
IF ( nRes = -1 )
WAIT WINDOW 'failure of SQLExec' NOWAIT
ENDIF
ENDSCAN

***************************************************************************



The code above works fine but when I try to do the following :
***************************************************************************
lcBatchSkey =jeinterface.batch_skey
nRes = SQLExec(nHan, "INSERT INTO jeinterface (batch_skey);
Values(lcBatchSkey) ")
****************************************************************************

The above insert does not work. So the question is how can I insert values from the jeinterface visual foxpro table to the SQL server table.


Any clue of what might be the problem.

Thanks,
Sergio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform