Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL server
Message
From
07/09/2002 12:25:04
Brian Roberts
Software Alternatives, Inc.
Houston, Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL server
Miscellaneous
Thread ID:
00697921
Message ID:
00697921
Views:
58
I am trying to use SQL server for the first time and I am having trouble.

Server box: Windows 2000 Advanced server; SQL 2000 running

System DSN has been defined for SQL

I have writen a small .prg using the Northwind database that comes with SQL2000. Using a remote view, I can update the 'products' table, however I cannot get the SQLCOMMIT() command to actually update the table.

Here is the code:

BLR = SQLCONNECT('sql')
TT='select * from products'
SQLEXEC(BLR,TT,'tmpfile')
SQLSETPROP(BLR,"Asynchronous",.F.)
SQLSETPROP(BLR,"BatchMode",.T.)
SQLSETPROP(BLR,"Transactions",2)
cursorsetprop('SendUpdates',.t.,'tmpfile')
cursorsetprop('Tables',products)
replace tmpfile.productname with 'test'
TTT=SQLCOMMIT(BLR)
wait window " sqlcommit returned " + alltrim(str(ttt))
SQLDISCONNECT(BLR)

The 'TTT' variable ALLWAYS returns a '1', but when I open another connection to check the table, no updates have been written!

I am VERY new to using SQL on the back end and have absolutely no idea what is wrong. What I need is a sample of code that opens a sql table, changes a field, and actually updates the sql table.

Thanking you in advance....

Brian Roberts
(a very confused programmer)
Next
Reply
Map
View

Click here to load this message in the networking platform