| Bug #1167 | MyODBC and Describe Table | ||
|---|---|---|---|
| Submitted: | 30 Aug 2003 7:10 | Modified: | 16 Oct 2003 22:32 |
| Reporter: | Ageu, Jr, Magrini | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
| Version: | 3.51.06 | OS: | Windows (Windows 98 SE) |
| Assigned to: | Venu Anuganti | CPU Architecture: | Any |
[6 Oct 2003 0:24]
Venu Anuganti
Hi !!
I am not able to reproduce the bavaviour as it simply works fine. Here is the test case and its output performed from 3.51.06 and 3.51.07:
Private Sub Describe_Click()
Dim Cn As New Connection
Dim rs As New Recordset
Dim Texto As String
Dim N, count, Rows As Integer
Cn.ConnectionString = "DSN=myodbc3;OPTION=35" ' try to avoid 35
Cn.Open
Cn.Execute "DROP TABLE t_desc"
Cn.Execute "CREATE TABLE t_desc(id int, id1 char(2) NOT NULL PRIMARY KEY DEFAULT '10')"
rs.Open "Describe t_desc", Cn, adOpenStatic, adLockOptimistic
rs.MoveFirst
Debug.Print String(15, "-") & "DESCRIBE t_desc " & String(15, "-")
For Each fld In rs.Fields
Debug.Print fld.Name,
Next
Debug.Print
Debug.Print String(35, "-")
Do Until rs.EOF
For Each fld In rs.Fields
Debug.Print fld.Value,
Next
rs.MoveNext
Debug.Print
Loop
Debug.Print "Total records: " & rs.RecordCount
rs.Close
End Sub
Output:
---------------DESCRIBE t_desc ---------------
Field Type Null Key Default Extra
-----------------------------------
id int(11) YES Null
id1 char(2) PRI 10
[30 Oct 2003 3:02]
Ageu, Jr, Magrini
I have two Mysql installed. One on Debian and other on Madrake. The Debian one is 3.23.49 There is no newer for debian. The Mandrake is 3.23.56. When I reported the problem I just tested with the debian. I note that the instructions works fine with Madrake one. But The problem is still happen with Debian. I thought bug is in Myodbc, because the instruction works fine in Debian console.

Description: The code below works fine with "Show tables", "show databases" but receives an error with "Describe (table)" . The Error is in the movenext point. The error just occurs when the next record has Null=Yes and there is no default value. The error is "Data provider or other service returned an E_FAIL status." How to repeat: Build a table with some field with Null=Yes and no default value. Try to use the code below to send the command "Describe table". --------------------------------------------------------------- Private Cn As adodb.Connection Private rs As adodb.Recordset Private Sub Command1_Click() Dim Texto As String Dim N As Integer On Error GoTo Error_Handler rs.CursorLocation = adUseClient rs.Open Text1.Text, Cn, adOpenStatic, adLockReadOnly MSF.Cols = rs.Fields.Count MSF.Rows = 0 For N = 0 To MSF.Cols - 1 Texto = Texto + rs.Fields(N).Name + Chr(9) Next MSF.AddItem Texto Texto = "" Do While Not rs.EOF For N = 0 To MSF.Cols - 1 Texto = Texto + rs.Fields(N) + Chr(9) Next MSF.AddItem Texto Texto = "" rs.MoveNext Loop MSF.FixedRows = 1 MSF.FixedCols = 0 rs.Close Exit Sub Error_Handler: Geral.Erro "Geral", "SqlReg", "SqlReg", Text1 End Sub Private Sub Form_Load() Set Cn = New adodb.Connection Set rs = New adodb.Recordset 'conn.ConnectionString = "DRIVER=MySQL;" Cn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _ & "SERVER=10.0.0.8;" _ & "DATABASE=pai;" _ & "UID=Juba;PWD=juba; OPTION=35;PORT=3306;" Cn.Open End Sub