AW: [Mono-list] MySql - ODBC

Schmuck schmuck at gecosoft.com
Wed Jun 7 06:14:26 EDT 2006


Used the latest ODBC-Driver supplied from www.mysql.com 
->libmyodbc3.so

odbc.ini:
[wintime_sql]
Driver	= MySQL ODBC 3.51 Driver
DATABASE	= wtimtestschmuck
PWD		= ####
SERVER	= localhost
UID		= #####

odbcinst.ini
[MySQL ODBC 3.51 Driver]
DRIVER	= /usr/lib/libmyodbc3.so
SETUP		= /usr/lib/libmyodbc3S.so
UsageCount	= 1

here is the code snipped

		If GlOdbcDsn <> "" Then
              VarConnStr = "DSN=" & GlOdbcDsn & ";" & _
                           "UID=" & GlDbUserName & ";PWD=" & GlDbPassword & ";"
900:        Else

              VarConnStr = "DRIVER={" & GlOdbcDriver & "};" & _
                           "SERVER=" & GlDbHost & ";" & _
                           "PORT=" & GlDbPort & ";" & _
                           "DATABASE=" & GlDbName & ";" & _
                           "UID=" & GlDbUserName & ";PWD=" & GlDbPassword & ";"

            End If

910:        For VarConnZ = 1 To ModConnMySqlOdbc.GetUpperBound(0)
920:          If ModConnMySqlOdbc(VarConnZ) Is Nothing Then Exit For
930:        Next

940:        If VarConnZ > ModConnMySqlOdbc.GetUpperBound(0) Then

950:          ReDim Preserve ModConnMySqlOdbc(VarConnZ)
960:          ReDim Preserve ModCommMySqlOdbc(VarConnZ)
970:          ReDim Preserve ModDRMySqlOdbc(VarConnZ)

980:          ModConnMySqlOdbc(VarConnZ) = Nothing
990:          ModCommMySqlOdbc(VarConnZ) = Nothing
1000:         ModDRMySqlOdbc(VarConnZ) = Nothing

            End If

1010:       ModConnMySqlOdbc(VarConnZ) = New Odbc.OdbcConnection(VarConnStr)
1020:       ModCommMySqlOdbc(VarConnZ) = New Odbc.OdbcCommand

 		Try

1040:         ModConnMySqlOdbc(VarConnZ).Open()

              Try

1050:           ModCommMySqlOdbc(VarConnZ).Connection = ModConnMySqlOdbc(VarConnZ)

		....


Usually our code exits by .Open() 

hope this helps.

Regards,
Schmuck

-----Ursprüngliche Nachricht-----
Von: T Senganal [mailto:tsenganal at novell.com]
Gesendet: Mittwoch, 7. Juni 2006 11:37
An: Schmuck; Mono-list at lists.ximian.com
Betreff: Re: [Mono-list] MySql - ODBC


Hi 

> have an issue using MySQL with ODBC.
> I have a System and User DSN, that I testet with "isql" succesfully.
> The problems begin with running our .Net --> see stacktrace

Odbc Provider usually works fine with mysql.. Can u pls post the code 
that causes the issue.. Also mention info on the Odbc Driver name and
version.. 

Regards
Senga



More information about the Mono-list mailing list