¤ I have installed MySQL Server 5.1 on my machine.
¤ I need to write a VB App that will allow me to connect to a database
¤ that is on my machine (localhost) "D:\MySQL Datafies\data\ibdata1"
¤
¤ I have been wrestling with various connect statements I found on
¤ connectionstrings.com specifically this one:
¤
¤ Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=myDataBase;
¤ User=myUsername;Password=myPassword;Option=3;
¤
¤ I believe my problem is the way I am entering "Database=myDataBase;"
¤ but just have no success.
¤ I am prepared to give up my first born to the person who gives me the
¤ proper connection string.
You may want to post the error you are receiving and a snippet of your code.
Paul
~~~~
Microsoft MVP (Visual Basic)
On Jul 31, 6:09 am, Paul Clement
<UseAdddressAtEndofMess...@swspectrum.com> wrote:
> You may want to post the error you are receiving and a snippet of your code.
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
Here are the various things I tried: ( Note: Bad attempts Commented
out )
Please remember for those who are not familar with MySQL Connector,
it brings up an input form with the parameters preloaded and a
connect button available.
Private Sub cmdConnectMySQL_Click()
Dim cnMySql As New rdoConnection
Dim rdoQry As New rdoQuery
Dim rdoRS As rdoResultset
' set up remote data connection using the
' MySQL ODBC driver
cnMySql.CursorDriver = rdUseOdbc
'cnMySql.Connect = "uid=;pwd=;server=;" & "driver={MySQL ODBC 3.51
Driver};database=;dsn='';"
'cnMySql.Connect = "uid=sysadmin;pwd=mypassword;server=localhost;" &
"driver={MySQL ODBC 3.51 Driver};database=simply;"
'cnMySql.Connect = "Driver={MySQL ODBC 3.51
Driver};Server=localhost;Database=d:\mysql datafiles\data\ibdata1;
User=sysadmin;Password=sysadmin;Option=3;"
cnMySql.Connect = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"Server=localhost;" & _
"Port=3306;" & _
"Option=16384;" & _
"Stmt=;" & _
"Database=d:\mysql datafiles\data\ibdata1;" & _
"Uid=sysadmin;" & _
"Pwd=myPassword;"
cnMySql.EstablishConnection
cnMySql.Close
End Sub
Error Message form EstablishConnection:
Run-time error: 40002
S1000: [MySql][OBDC 3.51 Driver] Access denied for user
'sysadmin@localhost' (Using Password=Yes)
Unless you have the connector installed, you won't be able to
duplicate the problem.
Duke
Paul Clement - 31 Jul 2008 18:27 GMT
¤ Here are the various things I tried: ( Note: Bad attempts Commented
¤ out )
¤
¤ Please remember for those who are not familar with MySQL Connector,
¤ it brings up an input form with the parameters preloaded and a
¤ connect button available.
¤
¤ Private Sub cmdConnectMySQL_Click()
¤ Dim cnMySql As New rdoConnection
¤ Dim rdoQry As New rdoQuery
¤ Dim rdoRS As rdoResultset
¤
¤ ' set up remote data connection using the
¤ ' MySQL ODBC driver
¤
¤ cnMySql.CursorDriver = rdUseOdbc
¤
¤ 'cnMySql.Connect = "uid=;pwd=;server=;" & "driver={MySQL ODBC 3.51
¤ Driver};database=;dsn='';"
¤
¤ 'cnMySql.Connect = "uid=sysadmin;pwd=mypassword;server=localhost;" &
¤ "driver={MySQL ODBC 3.51 Driver};database=simply;"
¤
¤ 'cnMySql.Connect = "Driver={MySQL ODBC 3.51
¤ Driver};Server=localhost;Database=d:\mysql datafiles\data\ibdata1;
¤ User=sysadmin;Password=sysadmin;Option=3;"
¤
¤ cnMySql.Connect = "DRIVER={MySQL ODBC 3.51 Driver};" & _
¤ "Server=localhost;" & _
¤ "Port=3306;" & _
¤ "Option=16384;" & _
¤ "Stmt=;" & _
¤ "Database=d:\mysql datafiles\data\ibdata1;" & _
¤ "Uid=sysadmin;" & _
¤ "Pwd=myPassword;"
¤
¤ cnMySql.EstablishConnection
¤
¤ cnMySql.Close
¤
¤ End Sub
¤
¤
¤ Error Message form EstablishConnection:
¤
¤ Run-time error: 40002
¤ S1000: [MySql][OBDC 3.51 Driver] Access denied for user
¤ 'sysadmin@localhost' (Using Password=Yes)
¤
¤
¤ Unless you have the connector installed, you won't be able to
¤ duplicate the problem.
You might want to take a look at the following thread:
http://forums.mysql.com/read.php?37,2688,2688#msg-2688
Paul
~~~~
Microsoft MVP (Visual Basic)
Henning - 31 Jul 2008 20:31 GMT
On Jul 31, 6:09 am, Paul Clement
<UseAdddressAtEndofMess...@swspectrum.com> wrote:
> You may want to post the error you are receiving and a snippet of your
> code.
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
Here are the various things I tried: ( Note: Bad attempts Commented
out )
Please remember for those who are not familar with MySQL Connector,
it brings up an input form with the parameters preloaded and a
connect button available.
Private Sub cmdConnectMySQL_Click()
Dim cnMySql As New rdoConnection
Dim rdoQry As New rdoQuery
Dim rdoRS As rdoResultset
' set up remote data connection using the
' MySQL ODBC driver
cnMySql.CursorDriver = rdUseOdbc
'cnMySql.Connect = "uid=;pwd=;server=;" & "driver={MySQL ODBC 3.51
Driver};database=;dsn='';"
'cnMySql.Connect = "uid=sysadmin;pwd=mypassword;server=localhost;" &
"driver={MySQL ODBC 3.51 Driver};database=simply;"
'cnMySql.Connect = "Driver={MySQL ODBC 3.51
Driver};Server=localhost;Database=d:\mysql datafiles\data\ibdata1;
User=sysadmin;Password=sysadmin;Option=3;"
cnMySql.Connect = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"Server=localhost;" & _
"Port=3306;" & _
"Option=16384;" & _
"Stmt=;" & _
"Database=d:\mysql datafiles\data\ibdata1;" & _
"Uid=sysadmin;" & _
"Pwd=myPassword;"
cnMySql.EstablishConnection
cnMySql.Close
End Sub
Error Message form EstablishConnection:
Run-time error: 40002
S1000: [MySql][OBDC 3.51 Driver] Access denied for user
'sysadmin@localhost' (Using Password=Yes)
Unless you have the connector installed, you won't be able to
duplicate the problem.
Duke
ibdata1 is a reserved filename used by InnoDB to log table usage.
Use the ODBC connector, setup a system DSN and try to connect to *your* db.
/Henning