Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC - INSERT INTO syntax question
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQLEXEC - INSERT INTO syntax question
Miscellaneous
Thread ID:
00599449
Message ID:
00599449
Views:
164
Hi,

I'm new to using VFP with SQL Server and I have a question about inserting records into a SQL Server database.

I am using the SQLEXEC command to do inserts right now. So far, the only fields I've updated have been character fields. The way I'm doing this is creating a string named 'strSQL' and building the insert command - then running SQLEXEC to insert the record.

For example:

lcText = "One"
lcText1 = "Two"
lnNumber = 1

strSQL = "Insert into tblTest(cText1, cText2, nNumber1) Values( "
strSQL = strSQL + "'" + (lcText) + "', "
strSQL = strSQL + "'" + (lcText1) + "', "
strSQL = strSQL + str(lnNumber) + ")"

lcSuccess = SQLEXEC(gnSQLSwitchParsingConn,strSQL)

Now, I want to do the same thing with datetime fields. How would I handle inserting records with those data types using SQLEXEC?
Al Williams

Anola MB, CANADA
Next
Reply
Map
View

Click here to load this message in the networking platform