Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to delete all the records from a FOXPRO table using VB.

Status
Not open for further replies.

tmarte

Programmer
Oct 22, 2001
8
US
I need help to delete all the records from a FOXPRO table using VB. I typed the following code:

'CONNECT
Set wrkSpace = CreateWorkspace("", "admin", "", dbUseODBC)
Set db = wrkSpace.OpenDatabase("Visual FoxPro Database")
Set rs1 = db.OpenRecordset("TAN2001")

'DELETE ALL RECORDS FROM ACCESS TABLE BEFORE POPULATING
db.Execute "DELETE ALL FROM TAN2001"
db.Execute "PACK TAN2001"

At this point I receive an error "ODBC call failed"

My question is: how can you delete records from a .DBC
a quick example would be very helpful!
 
Click Start -> Settings -> Control Panel -> ODBC Data Sources.

Click the User DSN tab, and find "Visual FoxPro Database" in the list. Select it and click the "Configure" button. Make sure the correct database type is selected and the path of your database is in the "Path" line.

--Adam
 
Thanks,
Everything goes fine and records are marked for deletion. Only that "PACK" or "ZAP" for some reason don't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top