Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete all rows in Access table
Message
From
10/08/2005 10:06:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Delete all rows in Access table
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01039854
Message ID:
01039854
Views:
66
I am having some problems getting the syntax correct working with Access. I need to open an Access table, delete all of the records in it and then add all new records from my VFP cursor. I have no problems adding the new records but I cannot seem to get the syntax right for removing all of the rows in the table. Below is a code snippet.

Thanks,
Bill
cMDB="F:\mwc_new1\fpdb\mwclist.mdb"

oAcc=CREATEOBJECT("Access.Application")
oAcc.OpenCurrentDatabase(cMDB)
cStatus=""
oMDB=oAcc.CurrentDB
oDB = oAcc.DBEngine
cTable="mwcStones"
oRS=oMDB.OpenRecordSet(cTable)

*% Need help here *%
omdb.Execute("DELETE mwstones.*")

* Code to add new records
* snip.....

oRS.UPDATE
oRS.CLOSE
oAcc.QUIT(1)
Next
Reply
Map
View

Click here to load this message in the networking platform