×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

This Action was canceled by an associated object (error #3426)

This Action was canceled by an associated object (error #3426)

This Action was canceled by an associated object (error #3426)

(OP)
The above error keeps popping up when I try to add a new record the access database connected to my vb6 program.

The debugger points to the line of code "datUser.addnew" as being the problem. datUser is the name of the data control connecting the database program and the program. Any ideas on what is causing this?

Jesse

RE: This Action was canceled by an associated object (error #3426)

Yeah paste some code right here so we can have a look.
Here's something to do also
Do you have VB6 Pro or higher?
If so use the Data Wizard to create a form to your Access database
It will create several button to add, delete, and update records
Look at what it writes for the correct syntax.

RE: This Action was canceled by an associated object (error #3426)

Private Sub cmdAdd_Click()
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew

Exit Sub
AddErr:
MsgBox Err.Description
End Sub

Here is a sample of what the data Form wizard created for Adding a new record.

click Add-Ins, AddIn Manager, find Data form Wizard in the list.
Next click the Loaded/unloaded radio button in the lower right.
It will show up when you click Add-Ins again.

RE: This Action was canceled by an associated object (error #3426)

This error is being generated because the AddNew command of a bound recordset causes Visual Basic to try to save the current record if the data has changed. Because the data control is currently pointing to a NULL record and not an empty record, the data cannot be saved so the "action was cancelled by an associated object" error is reported. This is commonly seen when using the data form wizard in Visual Basic versions 4.0 and 5.0. The data form wizard in Visual Basic 6.0 generates code for the ADO data control so this error is less likely to occur.


Eric De Decker
vbg.be@vbgroup.nl
Visual Basic Center

RE: This Action was canceled by an associated object (error #3426)

look at :

http://support.microsoft.com/support/kb/articles/Q189/8/51.ASP?LNG=ENG&SA=MSDN&FR=1

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close