OLE DB Connect Help Needed

  • Thread starter Thread starter matt889988
  • Start date Start date
M

matt889988

Hi everyone,

I'm having a problem connecting to a mySQL database using OLEDB with
vb.net.

open3 = New OleDbConnection
open3.ConnectionString = "Provider=SQLOLEDB; Data Source=www.db.edu;
Initial Catalog=xxx; User Id=XXX; PWD=XXX;"

Doesn't work: "Access Denied or server doesn't exist"

Yet:

open2 = New OdbcConnection
open2.ConnectionString = "Provider=MSDASQL; DRIVER={MySQL ODBC 3.51
Driver}; SERVER=" & txtServer.Text & ";" & "PORT=3306; DATABASE=xxx;" &
"USER=" & txtUser.Text & ";" & "PASSWORD=" & txtPass.Text & ";" &
"OPTION=3"

-- and --

open = New MySqlConnection
open.ConnectionString = "server=" & txtServer.Text & ";" & "user id=" &
txtUser.Text & ";" & "password=" & txtPass.Text & ";" & "database=xxx"

both work just fine. They all point to the same database, use the same
login and pass, and call the same database.


Thanks,
matt
 
open3.ConnectionString = "Provider=SQLOLEDB; Data Source=www.db.edu;
Initial Catalog=xxx; User Id=XXX; PWD=XXX;"

Doesn't work: "Access Denied or server doesn't exist"

Well it would do - you're trying to connect to a mySql database using the
SQL Server OleDb provider... :-)

"Provider=MySQLProv..............."
http://www.connectionstrings.com/
open = New MySqlConnection
open.ConnectionString = "server=" & txtServer.Text & ";" & "user id=" &
txtUser.Text & ";" & "password=" & txtPass.Text & ";" & "database=xxx"

At the risk of stating the obvious, why are you even trying to connect via
OleDb when you've got a working native .NET data provider...???
 
Back
Top