Can't connect to Access Data Base with ODBC connection

I am using Visual Web Developer and trying to connect to an Access data base in the code behind page  Default.aspx.vb.    I can't connect to my data base with the following code:

Dim connectionstring As String

connectionstring = _

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\asp\test02\App_Data\company.mdb;User Id=admin;Password=;"

Dim myConn As OdbcConnection = New OdbcConnection(connectionstring)

myConn.Open()

 

I alwasy get :   "Data Source not found and no default driver found:.   Does anyone know what I am doing wrong ??

0
jackm
2/8/2006 3:31:29 PM
📁 asp.net.access-datasource
📃 4679 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 683 Views

Check out http://www.connectionstrings.com/. 
Drill down into Access and you will see sample conection strings for
ODBC connections.  Is there a specific reason you want to use ODBC? 
OleDb is a better choice (and that is the format of the connection
string you have provided).

Terri Morton
Engagement Manager, Neudesic

How to ask a question

0
tmorton
2/12/2006 11:19:33 PM
Reply: