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

Updating dbase from VB, anyone?

Status
Not open for further replies.

DeltaTech

Programmer
Apr 16, 2003
92
MY
Hi
I am accessing a dbase file through VB to read and update data. While I can read, trying to perform an update causes the following error:

"-2147217911 (80040e09) Cannot update. Database or object is read only"

Here is my code:

[highlight]adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & m_sPath & ";Extended Properties=dBASE IV;User ID=Admin;Password="

adoRS.Open "Select * From \" & m_sFileName, adoConn, adOpenDynamic, adLockOptimistic ', adCmdText
[/highlight]

What am I doing wrong?
Oh, and can passwords be set for dbf files through VB code?

Very much appreciated.
Thanks
[bigcheeks]
 
Found the answer!
Apparently, Microsoft's newer data access components does not support updating dbase tables, and we should use DAO for this.
I tried and it works!
Check this out at Phew!
[Bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top