Hello
Anyone could you help i have got a strange problem when i update any record i get an error 2147467259 -(8000405) Insert Field failed. Where as on the same application i can add a new record. Please see below the code i have used dont know where am going wrong.

Private Sub cmdupdate_Click()
Set connection = New ADODB.connection

With connection


        .ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Port=3306;Database=apbooking;User=root;Password=root;Option=3;"


    .Open

    End With

 Set rsupdate = New ADODB.Recordset




'Update New Actual weight and number of boxes
With rsupdate
If .State = adStateOpen Then .Close
   .Open "select * from booking where hawb_no = '" & txthawb_no.Text & "'", connection, adOpenDynamic, adLockOptimistic
   .Fields(15) = txtactno_box.Text
   .Fields(16) = txtact_wt.Text
   .Fields(20) = txttemp.Text
   .Update



 End With
 MsgBox "Actual No of Boxes,Weight and Temperature Details Updated "
 Unload Me
 Me.Hide

End Sub

Recommended Answers

All 3 Replies

Error (80004005) as meaning the script could not access your data. The most likely reason is a permissions related problem. Your best chance of resolving this problem is to study carefully any associated message, for example, 'File already in use', or 'Logon Failed'.
Causes may be most likely :
1.Insufficient rights, wrong permissions.
2.If you are dealing with a phone number, make sure that you add it as string value and not as a pure number.
3.Third may be 'by design' in that the database has been locked by another process or user and therefore cannot accept a connection at this time.
RESOLUTION
1.When trying to pass values of the types, such as strings (BSTR), you must declare those field types explicitly instead of using adVariant.
2.Check the underlying database, for example, names, exclusive locks and especially permissions.

Thanks alot man i found the error it had to do with the Permissions i just recreated the Database structure and issue sorted .

glad to hear this...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.