Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From vfp update access table
Message
 
To
06/04/2004 15:36:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00892727
Message ID:
00892730
Views:
18
SQLExec(lnConnHandle,'delete from [otherissuer]',"__result")

select myresult
scan
lcsql = "insert into [otherissuer] (field1,field2) values ("
lcsql = lcsql + "'"+myresult.field1+"',"
lcsql = lcsql + "'"+myresult.field2+"')

SQLExec(lnConnHandle,lcsql,"__result")


endscan
>Hi
>
>We have some access table containing information about client. The main table about client is a foxpro free table and from foxpro we need to update the access table
>
>With this program I can export access table to vfp table and compare information with the master table (vfp free table). When some information is different I can make the change in the cursor but at the end I need to return the information in the original access table
>
>Here is the code I use to extract data from access.
>lcMDBDir = 'd:\bin\'
>lcMDBName = 'CFISSUER.MDB'
>lnConnHandle = SQLSTRINGCONNECT('DSN=MS Access Database;DBQ='+;
> lcMDBDir+'\'+lcMDBName+';DefaultDir='+;
> lcMDBDir+';DriverId=25;FIL=MS Access;MaxBufferSize=2048;'+;
> 'PageTimeout=5;UID=admin;')
>
>lcSQL = "select * from [otherissuer] " &&where [RequiredDate] between ?ldStart and ?ldEnd
>
>SQLExec(lnConnHandle, lcSQL, 'MyResult') && Get result into cursor myResult
>SQLDisconnect(lnConnHandle)
>Select myResult
>
>scan
>* here I can scan and compare with the master table and update the cursor (myResult) with the data from the master
>endscan
>
>* after I want to do something like delete all record in the access table(otherissuer) and import data from the cursor myResult
>
>Thanks
>
>Mike
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Reply
Map
View

Click here to load this message in the networking platform