M
Mika M
Hello!
I'm testing MySQL-database version 4.0.18, which contains table column
'ArticleNr' and data type is varchar length 40.
Connection is made using ODBC ConnectionString like ...
"DRIVER={MySQL ODBC 3.51
Driver};Server=localhost;Database=MyTesting;uid=XXX;pwd=ZZZ"
DataSet contains two tables Master and Child, and Relation between then is
defined like ...
ds.Relations.Add(New DataRelation("ChildRelation",
ds.Tables(0).Columns("ID"), ds.Tables(1).Columns("ID")))
Everuthing is working fine, but when I try to add new row into table like
....
Dim r As DataRow
r = ds.Tables(1).NewRow()
r("ArticleNr") = "1234567890"
'...some other fields here too
ds.Tables(1).Rows.Add(r)
.... I'll get an error like ...
"Cannot set column 'ArticleNr' to '1234567890'. The value violates the
MaxLength limit of this column."
When I check this column using 'Command Window - Immediate' like...
?ds.Tables(1).Columns("ArticleNr").MaxLength
8
Why 8 ??! Anyway length is 40 in database table! I'm wondering is the
problem in ODBC driver or connection, or my code, or MySQL database
settings. This ds.Tables(1) is Child-table for ds.Tables(0) Master-table.
How can I ensure MaxLength limit to 40 for this field?
Propably Microsoft people don't mind to help me because MySQL is not their
products, but maybe someone else would kindly help me.
I'm testing MySQL-database version 4.0.18, which contains table column
'ArticleNr' and data type is varchar length 40.
Connection is made using ODBC ConnectionString like ...
"DRIVER={MySQL ODBC 3.51
Driver};Server=localhost;Database=MyTesting;uid=XXX;pwd=ZZZ"
DataSet contains two tables Master and Child, and Relation between then is
defined like ...
ds.Relations.Add(New DataRelation("ChildRelation",
ds.Tables(0).Columns("ID"), ds.Tables(1).Columns("ID")))
Everuthing is working fine, but when I try to add new row into table like
....
Dim r As DataRow
r = ds.Tables(1).NewRow()
r("ArticleNr") = "1234567890"
'...some other fields here too
ds.Tables(1).Rows.Add(r)
.... I'll get an error like ...
"Cannot set column 'ArticleNr' to '1234567890'. The value violates the
MaxLength limit of this column."
When I check this column using 'Command Window - Immediate' like...
?ds.Tables(1).Columns("ArticleNr").MaxLength
8
Why 8 ??! Anyway length is 40 in database table! I'm wondering is the
problem in ODBC driver or connection, or my code, or MySQL database
settings. This ds.Tables(1) is Child-table for ds.Tables(0) Master-table.
How can I ensure MaxLength limit to 40 for this field?
Propably Microsoft people don't mind to help me because MySQL is not their
products, but maybe someone else would kindly help me.