By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Access 2000 and VB6 gives me 3426 error

P: n/a
Hi. I am trying to add new records to an Access 2000 database using VB6.
But I keep getting this 3426 "action cancelled by object" error. I've
updated DAO to 3.6 and checked MSDN. Their code doesn't do anything. Here's
my code. How do I connect to Access 2000 properly and add records without
getting that 3426 error. Thanks in advance.

Dim dbs As Database
Dim rs As DAO.Recordset
Set dbs = DBEngine(0).OpenDatabase(dFileName)
Set rs = dbs.OpenRecordset("PCA")
Set Data1.Recordset = rs
CustomerID.Text = CustomerId(1000)
Data1.Recordset.AddNew
Data1.UpdateRecord

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I believe I had a similar error condition when tapping into Access databases
via asp.net web pages (we used very similarly coded connections to the
database).

My solution: open the database connection only long enough to update the
record, then close the database connection from the outside application.

If you leave the connection open, Access locks the database to a
considerable degree to protect it's own data integrity, and you can't get at
the data again until you close the connection. Sometimes closed by shutting
down the outside application, sometimes by shutting down the pc or server
holding the database.

Bruce Pick

"Michelle" <Cu***@4.you> wrote in message
news:Xn*********************@129.250.170.88...
Hi. I am trying to add new records to an Access 2000 database using VB6.
But I keep getting this 3426 "action cancelled by object" error. I've
updated DAO to 3.6 and checked MSDN. Their code doesn't do anything. Here's my code. How do I connect to Access 2000 properly and add records without
getting that 3426 error. Thanks in advance.

Dim dbs As Database
Dim rs As DAO.Recordset
Set dbs = DBEngine(0).OpenDatabase(dFileName)
Set rs = dbs.OpenRecordset("PCA")
Set Data1.Recordset = rs
CustomerID.Text = CustomerId(1000)
Data1.Recordset.AddNew
Data1.UpdateRecord

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.