Avatar of stellyuk
stellyuk
 asked on

problem connecting with Access 2007

HI there,

Can any of you see anything wrong with this line:
<add name="Connection" providerName="Microsoft.ACE.OLEDB.12.0;" connectionString="Data Source=C:\Documents and Settings\Stelly\My Documents\ENVPR041-Amalgamation_ of_ Inventories\Environment_Applications_Inventory.accdb;Persist Security Info=False;"/>

When I use it I ge the error:

Unable to find the requested .Net Framework Data Provider.  It may not be installed.

I have been trying to do this for ages, but I can get any joy... I would really appriciate all the help that I can get with this :)

Stelly
C#.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
josgood

8/22/2022 - Mon
josgood

Sounds like the Microsoft Jet 4.0 OLE DB Provider is missing

http://support.microsoft.com/kb/821765
mentions, among other things (they're giving an example, of course)
Open a connection to the Access database
1.      On the View menu, click Server Explorer.
2.      In Server Explorer, right-click Data Connections, and then click Add Connection.
3.      In the Data Link Properties dialog box, click the Provider tab.
4.      In the OLE DB Provider(s) list, click Microsoft Jet 4.0 OLE DB Provider, and then click Next.
5.      Click the Connection tab, and then click the ellipses button (...).
6.      Locate the Access database testdb.mdb file that you created by following the corresponding path on your computer.
7.      Select the testdb.mdb file, and then click Open.
8.      In the Data Link Properties dialog box, click OK.

stellyuk

ASKER
Ok I have this connection string now...
<add name="Connection" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Data Source=C:\Applications_Inventory.accdb;Persist Security Info=True" providerName="System.Data.OleDb"/>

I'm now getting "Not a valid file name" any ideas? I'm trying to access a Access 2007 database...

Stelly
josgood

You've already checked and C:\Applications_Inventory.accdb really exists.

I suggest either using double backslashes "C:\\Applications_Inventory.accdb" or preceding the string with an "at" sign, as in @"C:\Applications_Inventory.accdb"

Joe
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
stellyuk

ASKER
I have checked, and I'm getting the same error after changing the connection string to:

<add name="Connection" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Data Source=J:\\Applications_Inventory.accdb;Persist Security Info=True" providerName="System.Data.OleDb"/>

Any ideas?

Stelly
stellyuk

ASKER
Can anyone help pls?

Stelly
josgood

Silly us. "Data Source=Data Source="

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
josgood

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.