AW: [Mono-list] MySql - ODBC

Schmuck schmuck at gecosoft.com
Mon Jun 12 02:31:48 EDT 2006


Hi,

> 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

I 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


' Stacktrace:
'-------------------------------

Hi @all,

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.

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Stacktrace:

in (wrapper managed-to-native) System.Data.Odbc.libodbc:SQLConnect (intptr,string,int16,string,int16,string,int16) <0x4>
in (wrapper managed-to-native) System.Data.Odbc.libodbc:SQLConnect (intptr,string,int16,string,int16,string,int16) <0xfffff9a4>
in System.Data.Odbc.OdbcConnection:Open () <0x3fc>
in (wrapper remoting-invoke-with-check) System.Data.Odbc.OdbcConnection:Open () <0xffffe63c>
in gecoComNet.GecoDb:Open (bool) <0x288c>
in gecoComNet.GecoDb:SqlSnap (int&,string,bool) <0x1a3>
in gecoComNet.GecoApi:SystemConfig (bool) <0x1a7f>
in gecoComNet.GecoMain:Run () <0xc1>
in gecoComNet.gecoStart:Main () <0x190>
in (wrapper runtime-invoke) System.Object:runtime_invoke_void (object,intptr,intptr,intptr) <0xc75fbd87>

Native stacktrace:

        mono-1.1.15/bin/mono(mono_handle_native_sigsegv+0xbb) [0x8153d0b]
        mono-1.1.15/bin/mono [0x813e66f]
        [0xffffe440]
        /usr/lib/libmyodbc3.so(get_charset_number+0x71) [0x4103ee41]
        /usr/lib/libmyodbc3.so(get_charset_by_csname+0x33) [0x4103f133]
        /usr/lib/libmyodbc3.so(mysql_real_connect+0x537) [0x410589c7]
        /usr/lib/libmyodbc3.so(SQLConnect+0x4eb) [0x4102133b]
        /usr/local/lib/libodbc.so(SQLConnect+0x4d7) [0x40fb42a7]
        [0x40f89d44]
        [0x40f89685]
        [0x40f89219]
        [0x40f8781d]
        [0x40f8c3ec]
        [0x40ef6f28]
        [0x40d496aa]
        [0x40b42d81]
        [0x40b427be]
        mono-1.1.15/bin/mono [0x813e520]
        mono-1.1.15/bin/mono(mono_runtime_invoke+0x27) [0x80d7b67]
        mono-1.1.15/bin/mono(mono_runtime_exec_main+0x5c) [0x80d8c9c]
        mono-1.1.15/bin/mono(mono_runtime_run_main+0x171) [0x80d88c1]
        mono-1.1.15/bin/mono(strftime+0x1ba2) [0x805c602]
        mono-1.1.15/bin/mono(mono_main+0x857) [0x805cfe7]
        mono-1.1.15/bin/mono(__fxstat64+0x12b) [0x805b9bb]
        /lib/tls/libc.so.6(__libc_start_main+0xd0) [0x4012bea0]
        mono-1.1.15/bin/mono(sinh+0x41) [0x805b911]
Abgebrochen


Can anyone give us please advise?

Regards,
Stephan




More information about the Mono-list mailing list