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

Using VB to enter data into a MySql table

Status
Not open for further replies.

rw73

Programmer
Feb 21, 2002
10
US
I am using Mysql tables to store data that is entered through a Visual Basics interface program. When adding new records to a table the first record in the table is accepted fine, however, any subsequent data that I enter must only contain the same number of or less characters in each field as the first record entered. An example is if I enter a customer name for the first record that is 15 characters long, from that point on only customer names of 15 characters or less are accepted. If I enter data longer than the first record I receive the following error message:

Run-time error '-2157217887 (80040e21): Multiple-step operation generated errors. Check each status value.

I am connecting to MySql with no DSN. Any help will be greatly appreciated.
 
I am having similar problem.
Are you able to solve it.

thank you
 
Tinso, rw73 is using ADO to connect without ADO.

rw73 and varun, are you sure you are not trying to push too many characters to the field? the only time i have received that error was when tried to push 20 + chars to a char(20) field. it drove me crazy and to make matters worse microsoft gives a couple of reasons this error can occour, but i never saw that mentioned.
 
Hi all,

I too have had that problem. And yes, sadly, Microsoft was absolutely of no assistance.

The only solution I came up with is as follows:

-->>Instead of using rs.AddNew and then rs.Update to add record, I used the Insert method.

ie) With rs
.AddNew
.Fields!FieldName.Value = "Some Value"
.Update
End With


-->>Instead, I used the Insert method as follows:

ie) strSql = &quot;INSERT INTO <TableName> VALUES (<Insert Values Here>)&quot;
cmd.Execute strSql

This of course assumes that all proper declarations are made, and that the connection object is initialized and opened, etc. It worked for me, but your situation may be different...

Hope this helps!!
 
Griffinator

< And yes, sadly, Microsoft was absolutely of no assistance.

Why would Microsoft be of assistance for an Open source database like MySQL?

I think we expect too much from good old Uncle Bill sometimes!
[lol]


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top