Andrew Herrmann
Apr 28th, 2000, 04:42 AM
I'm currently using VB 6.0 and MySQL server. I'm trying to add a record to a table and getting a strange error. I'm using the following code:
selStmt = "SELECT * FROM customer;"
recset1.Open selStmt, cnn1, adOpenKeyset, adLockPessimistic
With recset1
.AddNew
.Fields("cust_name") = CustomerName
.Fields("contact_name") = ContactName
.Update
.Requery
.MoveLast
.Close
End With
If the data for either field exceeds 14 characters, I get the following error:
------
Run-time error '-2147217887 (80040e21)':
Errors occurred
------
If I debug, it places me on the ".fields" line for the field in which I exceeded 14 characters.
Both fields are set up as varchar(40). If I try to add the same data to the table using Access, I don't have any problems at all.
I'm out of ideas on this, so if anyone has any ideas....
Thanks!
selStmt = "SELECT * FROM customer;"
recset1.Open selStmt, cnn1, adOpenKeyset, adLockPessimistic
With recset1
.AddNew
.Fields("cust_name") = CustomerName
.Fields("contact_name") = ContactName
.Update
.Requery
.MoveLast
.Close
End With
If the data for either field exceeds 14 characters, I get the following error:
------
Run-time error '-2147217887 (80040e21)':
Errors occurred
------
If I debug, it places me on the ".fields" line for the field in which I exceeded 14 characters.
Both fields are set up as varchar(40). If I try to add the same data to the table using Access, I don't have any problems at all.
I'm out of ideas on this, so if anyone has any ideas....
Thanks!