Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating SQL with fox tables
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00151251
Message ID:
00151337
Views:
24
Hi Gray,

I do a similar thing. See Sample Below. Try It Out..


nc=SQLCONNECT('backend',"sa","")
set date ameri

** Sales File
select 0
If Used("Sales")
USE IN SALES
ENDIF
Select 0
Use Sales
Go Top
Scan
wait wind Nowait Allt(str(x))+" - "+Allt(str(recno()))
cSQL = "Insert INTO SALES (STORE,REGISTER,journal,cbarcode,nprice,ncost,nqty, " +;
"nnetprice,ngrossprice,date ) " + ;
"Values ("+;
allt(str(laDB[x,2]))+ ", " + ;
allt(str(sales.register))+ ", " + ;
allt(str(Sales.Journal))+ ", " + ;
"'" + allt(sales.cbarcode) + "', " + ;
allt(str(Sales.nPrice))+ ", " + ;
allt(str(Sales.ncost))+ ", " + ;
allt(str(Sales.nqty))+ ", " + ;
allt(str(Sales.nNetPrice))+ ", " + ;
allt(str(Sales.nGrossPrice))+ ", '" + ttoc(dtot(sales.date)) +"' )"

nerror =SQLExec(nc,cSQL)
if nerror < 0
aerror(f)
disp memo like f
? " error"
Suspend
Endif
EndScan

close all
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Previous
Reply
Map
View

Click here to load this message in the networking platform