Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete all rows in Access table
Message
From
10/08/2005 11:40:32
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01039854
Message ID:
01039884
Views:
18
Yuri,

Thank you! It worked just like I wanted.

Bill

>oAcc.CurrentDB.execute("Delete * from "+cTable)
>
>>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)
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform