Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting records to SQL Server
Message
De
30/10/2001 19:51:07
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
 
 
À
29/10/2001 17:38:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00574760
Message ID:
00575414
Vues:
25
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform