0 Replies - 730 Views - Last Post: 17 August 2009 - 02:25 AM Rate Topic: -----

#1 javamad  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 70
  • Joined: 08-June 09

Connection to MySQL database error

Post icon  Posted 17 August 2009 - 02:25 AM

Hi,
I am trying to connect to a MySQL database but am getting the following error in my connection procedure:

Run-time error '-2147467259 (80004005)':

[MySQL][ODBC 5.1 Driver] Access denised for user 'USER1PASSWORD = PA'@'localhost' (using password:NO)

I have downloaded the MYSQL connnection modue from the MySQL website and I have added
ActiveX Data Objects library in references, but the code still falls over

If someone could help it would be much appreciated

Please see the connection code below.

Many thanks

Sub DatabaseConnection()

localhost = "xxxx"
DATABASE1 = "xxxx"
USER1 = "xxxx"
PASSWORD1 = "xxxxxxxxx"


Set cn = New ADODB.Connection
cn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _
"SERVER=localhost;" & _
"DATABASE=DATABASE1;" & _
"USER=USER1" & _
"PASSWORD=PASSWORD1;" & _
"Option=3"


End Sub

This post has been edited by javamad: 17 August 2009 - 03:02 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1