I use MyODBC 2.50.37 and MySQL 3.23.36 to 38 (bug fixed) and we have anytime
the same trouble. Null value with NOT NULL TEXT fields.
This is my Test Example:
I use de DB Test:
CREATE TABLE t_testnull (
ID tinyint(4) NOT NULL auto_increment,
TestTEXTNotNULL text NOT NULL ,
TestTEXTNull text ,
PRIMARY KEY (ID)
);
I use Visual Basic 6.0 with SP 5 with ADO 2.6, and my code is:
Private WithEvents con_Test As ADODB.Connection
Private WithEvents rs_Test As ADODB.Recordset
Private Sub Form_Load()
Set con_Test = New ADODB.Connection
Set rs_Test = New ADODB.Recordset
str_ConnectionString = "DRIVER={MySQL}" & _
";DB=test" & _
";SERVER=localhost" & _
";UID=root" & _
";PWD=" & _
";PORT=3306" & _
";OPTION=131072;STMT=;"
con_Test.ConnectionString = str_ConnectionString
con_Test.Open
rs_Test.Open "INSERT INTO t_TestNull (testTEXTNotNULL,TestTEXTNull)
VALUES ('','');", con_Test
rs_Test.Open "SELECT * FROM T_TestNULL", con_Test
Do Until rs_Test.EOF = True
Debug.Print rs_Test.Fields(1).Value; rs_Test.Fields(2).Value
rs_Test.MoveNext
Loop
End Sub
and this code give me always NULL from MySQL database. I tried many options
of MyODBC but these didn't work. I have tried with the Addnew Method but it
gave the same results.
On MySQL FAQ Site, its tel to use the Recordset.Cursorlocation =
adUseClient, but this action return me a E-FAIL Status and when I tried to
use the MoveLast method ADO tell me that "Rowset does not support fetching
backward".
I use Windows 2000 Server with AMD K62-380 CPU, 97Mo RAM. I had tried with
a PIII 600 with 380 MoRAM with Windows 98, and the same things is happening.
Did someone can tell me what happend because this NULL value is a nightmare.
I not realy familiar with this technologie.
Do you know how to link libMYSQL.dll like a Windows DLL in VB?
DECLARE FUNCTION mysql_init FROM.....
and the kind of TYPE we had to declare.
The NULL Value is the most important think to solve.
Other question, did some one know how to support SSL with MySQL?
the same trouble. Null value with NOT NULL TEXT fields.
This is my Test Example:
I use de DB Test:
CREATE TABLE t_testnull (
ID tinyint(4) NOT NULL auto_increment,
TestTEXTNotNULL text NOT NULL ,
TestTEXTNull text ,
PRIMARY KEY (ID)
);
I use Visual Basic 6.0 with SP 5 with ADO 2.6, and my code is:
Private WithEvents con_Test As ADODB.Connection
Private WithEvents rs_Test As ADODB.Recordset
Private Sub Form_Load()
Set con_Test = New ADODB.Connection
Set rs_Test = New ADODB.Recordset
str_ConnectionString = "DRIVER={MySQL}" & _
";DB=test" & _
";SERVER=localhost" & _
";UID=root" & _
";PWD=" & _
";PORT=3306" & _
";OPTION=131072;STMT=;"
con_Test.ConnectionString = str_ConnectionString
con_Test.Open
rs_Test.Open "INSERT INTO t_TestNull (testTEXTNotNULL,TestTEXTNull)
VALUES ('','');", con_Test
rs_Test.Open "SELECT * FROM T_TestNULL", con_Test
Do Until rs_Test.EOF = True
Debug.Print rs_Test.Fields(1).Value; rs_Test.Fields(2).Value
rs_Test.MoveNext
Loop
End Sub
and this code give me always NULL from MySQL database. I tried many options
of MyODBC but these didn't work. I have tried with the Addnew Method but it
gave the same results.
On MySQL FAQ Site, its tel to use the Recordset.Cursorlocation =
adUseClient, but this action return me a E-FAIL Status and when I tried to
use the MoveLast method ADO tell me that "Rowset does not support fetching
backward".
I use Windows 2000 Server with AMD K62-380 CPU, 97Mo RAM. I had tried with
a PIII 600 with 380 MoRAM with Windows 98, and the same things is happening.
Did someone can tell me what happend because this NULL value is a nightmare.
I not realy familiar with this technologie.
Do you know how to link libMYSQL.dll like a Windows DLL in VB?
DECLARE FUNCTION mysql_init FROM.....
and the kind of TYPE we had to declare.
The NULL Value is the most important think to solve.
Other question, did some one know how to support SSL with MySQL?