General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
ODBC -- inserting records into SQL Server
Environment versions
Network:
Windows 2000 Server
I am trying to insert records into SQL Server from Fox via ODBC, and this should be a simple task (I've been selecting data without problem), but I'm having no luck so far.
My coding (simplified) is:
CREATE DATABASE test
CREATE CONNECTION MyODBC DATASOURCE "purges_tmp" USERID "taskadmin" PASSWORD "taskadmin"
pn1 = SQLConnect( pc_dsrc, pc_uid, pc_uid )
DISPLAY CONNECTIONS
SELECT dlvm
pc_acct = acct_no
pc_data = dataline
pn_sqle = SQLExec(pn1, "INSERT vz_notes (dbacct, dataline) VALUES(pc_acct, pc_data)")
=SQLDISCONNECT( pn1)
DELETE CONNECTION MyODBC
I am consistently getting a return of 1 for the SQLConnect, and (-1) on the SQLExec. Is my syntax wrong, or could the SQL Server table be locked to updates? What am I missing here?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only