MySQL Connection

Hello Everyone,

I am trying to connect from my Local to MySQL and keep getting the following error message:

‘Error connecting’

Here is my code:

(Options):

Option Public

Option Declare

UseLSX “*LSXODBC”

Initialize:

Dim session As New NotesSession

Dim db As NotesDatabase

Dim v As NotesView

Dim doc As NotesDocument

Set db = session.currentdatabase

Set v = db.GetView(“GimData”)

Set doc = v.GetFirstDocument

Dim con As New odbcconnection

Dim qry As New odbcquery

Dim result As New odbcresultset

Dim dataSource As String

Dim username As String

Dim password As String

Set qry.Connection = con

Set result.Query = qry

Set result.Connection=con

dataSource = “MySQL”

username=“Username”

password=“password”

If Not(con.ConnectTo(dataSource,username,password)) Then

Messagebox “Error connecting.”,16,“Sorry”

Else

ODBC Driver (MySQL ODBC 5.1 Driver) is in my system(user DSN). Data source name is"MySQL". If I test this connection from User DSN is says - Connection Successful.

THANK YOU FOR YOUR HELP

-vadim

Subject: MySQL Connection

Try using the ODBCConnection.GetExtendedErrorMessage method to check why the connection failed.Your code should be something like this:

If Not(con.ConnectTo(dataSource,username,password)) Then

Messagebox “Error connecting:”+Chr(13)+con.GetExtendedErrorMessage,16,“Sorry”

Else

Subject: RE: MySQL Connection

Issue has been resolved with 32 bit driver.