4 messages in com.mysql.lists.win32Problem with LONGTEXT field| From | Sent On | Attachments |
|---|---|---|
| deep kapasi | 18 Sep 2002 21:42 | |
| Yves LUDWIG | 19 Sep 2002 05:23 | |
| deep kapasi | 21 Sep 2002 05:10 | |
| Mike Hillyer | 21 Sep 2002 09:16 |
| Subject: | Problem with LONGTEXT field![]() |
|---|---|
| From: | deep kapasi (dbka...@yahoo.co.in) |
| Date: | 09/18/2002 09:42:36 PM |
| List: | com.mysql.lists.win32 |
Hi,
I am using MySQL 4.0.3 (max-nt) and MyODBC 3.51.03 and facing strange problem while accessing a LONGTEXT Column, to generate the Bug pls follow the below step
Platform: Window 2k Server Application: Visual Basic 6.0 (No Service Pack)
1. Run following SQL Script
USE Test; CREATE TABLE `testing` ( `ID` int(11) NOT NULL auto_increment, `FLD1` longtext, PRIMARY KEY (`ID`) ) TYPE=InnoDB;
INSERT INTO Testing(FLD1) VALUES("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), ("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB");
2. Start a New Visual Basic Project (Standard .exe) 3. Add reference of ADO (any ver 2.0, 2.1 OR 2.5. I have tested with 2.0) 4. Paste the below code in Form_Load() event
Private Sub Form_Load() Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset
cnn.Open "Driver={MySQL ODBC 3.51 Driver};SERVER=localhost;DB=test;UID=root;PWD=;OPTION=35" Set rst = cnn.Execute(CommandText:="SELECT * FROM Testing", Options:=adCmdText) With rst If IsNull(.Fields("FLD1").Value) Then MsgBox "IT IS NULL" Else MsgBox "IT IS NOT NULL" End If If IsNull(.Fields("FLD1").Value) Then MsgBox "IT IS NULL" Else MsgBox "IT IS NOT NULL" End If End With End Sub
4. Now Run the project. It will display 2 MessageBox, first messagebox will display "IT IS NOT NULL" while second will display "IT IS NULL". Isn't it Strange? How did the value of FLD1 changed to NULL?.
Same problem is not coming if client-side recordset is created i.e. replace following line in above code Set rst = cnn.Execute(CommandText:="SELECT * FROM Testing", Options:=adCmdText) with below 3 lines Set rst.ActiveConnection = cnn rst.CursorLocation = adUseClient rst.Open Source:="SELECT * FROM Testing", Options:=adCmdText
Now run the project again and both time messagebox will display "IT IS NOT NULL" message.
Is it a MySQL Bug OR Am I missing something? Any help is appreciated.
Regards, Deep
________________________________________________________________________ Missed your favourite TV serial last night? Try the new, Yahoo! TV. visit http://in.tv.yahoo.com




