Visual Studio .NET Data Connection to MS ACCESS

I am using VS .NET 2003, and have several Data Connections set up to SQL Servers. Now though, I want to add a Data Connection for a .mdb file on my F: network drive.  I set up an ODBC connection to it, this ODBC connection works fine. But there is no option in the Data Conenction configuration tool to use the ODBC connection, on the Provider tab.

Basically I want to get the connection string to put in my web.config file, if some knows how to put together a connection string to a .mdb file that would work for me too.

I tried to use the OLEDB Simple Provider driver in the Provider tab, but this did not work, it didn't recognize my F: drive path.

Ideas?
RichardFoxAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
AerosSagaConnect With a Mentor Commented:
It can be done like so:

<appSettings>
            <add key="SiteDB" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Inetpub\wwwroot\DOTNETShoppingCart\Database\Site.mdb;"></add>
            <!-- <add key="SiteDB" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=D:\LocalUser\INET_savoyfurniture\Includes\Site.mdb;"></add> -->
      </appSettings>

Regards,

Aeros
0
 
mmarinovConnect With a Mentor Commented:
Hi,

go to http://www.connectionstrings.com/ and get the needed connection string

Regards,
B..M
0
 
RichardFoxAuthor Commented:
tried both of these

      <add key="CLOSBIND_MDB"
         value="driver={Microsoft Access Driver (*.mdb)};Dbq=F:\ODBC\closbind.mdb;"/>
      <add key="CLOSBIND2_MDB"
         value="provider=Microsoft.Jet.OleDb.4.0;data source=F:\odbc\closbind.mdb;"/>

getting errors:

Keyword not supported: driver
and
Keyword not supported: provider
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mmarinovCommented:
have you checked the link i've send you ?

B..M
0
 
RichardFoxAuthor Commented:
Yes, that site's strings are reflected in my connection strings (I try both ODBC and OLEDB). Case has no effect
0
 
AerosSagaCommented:
provider should be Provider

data source should be Data Source
0
 
RichardFoxAuthor Commented:
Ooops, stand by I was trying to use SqlConnection with OLEDB and ODBC connection strings...
0
 
AerosSagaCommented:
lol that'll do it
0
 
RichardFoxAuthor Commented:
That's wierd. Now I'm getting

'F:\ODBC\closbind.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

But I assure you this is a valid path to a network drive. Could it be that IIS cannot resolve this path though?
0
 
AerosSagaCommented:
If the server can resolve the path then IIS should be able to as well, I'm guessin theres some other issue at work here
0
All Courses

From novice to tech pro — start learning today.