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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating DBF file Using VB 6

Status
Not open for further replies.

33216CLC

Programmer
Aug 17, 2000
173
BS
I am writing an interface program and I need to be able to update records in a dbf table. How can I go about this?

Thanks,

Cooleen
 
Didn't we go through this a couple of months ago?? I get the distinct feeling of deja vu????

Link the DBF into an Access database and then you can treat the dbf just like an Access table.
To achieve the linking, click on "New" on the "Table" tab and select "Link Table" from the list. Change the "Files Of Type" drop down list to "Microsoft FoxPro" and navigate to your dbf. Follow the instructions.

Alternatively, you could possibly try to create an ODBC source to the DBF - don't know if this is possible and have not tried - and use this source in VB to connect to the DBF.

Simon
 
Thanks Simon, and yes we did go through how to link the dbf file to a table in Access. However we did not go through updating the actual dbf file. I tried updating the records from within Access but I could not and I do not think that updating the recordset through VB is allowed. The only way to actually update would have to be through creating an ODBC source to the dbf file as you suggested. My question was, "How can this be done?". Is this done exactly as it is done with Access? I'll attemp to do this and get back to you.


Thanks Simon,

Cooleen
 
Guess what Simon,

I spent about 6.5 hours trying to get a connection to the dbf file that would allow me to update the records. I finally discovered that eventhough I cannot update the records from within Access, I can with code in VB. I guess this is precisely what you were saying. I assumed that since I was unable to update the records by manually opening the link in Access, using code would produce the same results. Well, my wrong.

Thanks Simon,

Cooleen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top