Last post Dec 01, 2008 07:49 AM by Mikesdotnetting
Nov 25, 2008 02:58 AM|kashivis|LINK
I have an Access 2007 Database in my IIS server under App_Data.
I would like to connect to the database. I am using Web Developer 2008 and am struggling to get the correct connection string.
Can someone help?
Nov 25, 2008 03:34 AM|mjhufford|LINK
Have you tried this site before:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;
Nov 26, 2008 01:07 AM|kashivis|LINK
Thanks for your response. Yes, I did try the string. I am getting these errors:
(1) If I select Microsoft Access Database File as the
Data source with .Net framework Data Provider for OLE and insert the connectionstring above, it gives the error:
"Format of the initialization string does not confirm to specification starting at index 0."
(2) If I select Microsoft ODBC Data source, entering the connection string doesn't give me the O.K. button. I have not set username and password for my access (accdb).
(3) For the Microsoft ODBC Data source, using the user or system data source name which points to my accdb, prompts me for username and password, which I don't have, as I have not configured my access db for it.
(4) Using Other with .NET Framework Data Provider for OLE DB
with OLE DB provider as Microsoft Access 12.0 Access Database Engine OLE DB
and pointing to the accdb filename gives the error:
"Object reference not set to an instance of an object."
Would appreciate guidance.
Nov 26, 2008 07:05 AM|Mikesdotnetting|LINK
In your web.config file, add the following within the <configuration> section:
<add name="MyConn" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|name_of_db.accdb;"
Then when you use the SqlDataSource, a connection called MyConn will be available in the dropdown menu.
Dec 01, 2008 03:22 AM|kashivis|LINK
I added the connection string in web.config.
Seek your help to understand how to use SqlDataSource in Visual Web Developer 2008 Express Edition? I don't have this option.
The options available are:
Thanks for your help.
Dec 01, 2008 07:49 AM|Mikesdotnetting|LINK
Assuming you added the connection string to the web config correctly, the first step you come to in the SqlDataSource configuration wizard is the option to "Choose Your Data Connection". The connection string you just added should be in the dropdown on