I am trying to connect to my Access Database. Is this the correct way my "web.config" should be setup? The error is " Unrecognized element." and it is referent to Line 1 "<configuration>" All help is appreciated. Thank You.
I am trying to connect to my Access Database. Is this the correct way my "web.config" should be setup? The error is " Unrecognized element." and it is referent to Line 1 "<configuration>" All help is appreciated. Thank You.
The link you provided is dealing with the new ACE driver, which is needed for .accdb (access 2007 and above) files only. The oledb 4.0 driver is installed by default on any windows system. But this is not the problem at all!
eric.silva
I'm sorry I still don't understand would it look like the web.config code below? When I launch the application I recieve the following error:
"Microsoft OLE DB Provider for ODBC Driverserror '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/authentication/new_user_form.asp, line 130"
You're mixing up classic asp (.asp) and ASP.NET (.aspx). The connectionstring section in web.config is part of ASP.NET, but you're writing a classic asp page. So what do you want? If you want to learn classic ASP, you'll need to ask your questions elsewehere,
since these forums are dealing with ASP.NET related questions only. If you want to learn ASP.NET, go to the
Get Started section in this website and start at the beginning
The link you provided is dealing with the new ACE driver, which is needed for .accdb (access 2007 and above) files only. The oledb 4.0 driver is installed by default on any windows system. But this is not the problem at all!
Hello:)
In my mind, it has included *.mdb——From the file I saw——
Overview
This download will install a set of components that facilitate the transfer
of data between existing Microsoft Office files such as Microsoft Office Access
2010 (*.mdb and *.accdb) files and Microsoft Office Excel 2010 (*.xls, *.xlsx,
and *.xlsb) files to other data sources such as Microsoft SQL Server.
In my mind, it has included *.mdb——From the file I saw——
Decker, you can connect to mdb files with the new ACE driver also, but that isn't necessary at all, because the oledb 4.0 driver can do that. In his connection string he's not even using the ACE driver, so how could you think this would be the problem?
But you didn't read the next part of my reply! Whatever connectionstring or driver he would use, it will not work when mixing classic ASP and ASP.NET.
eric.silva
Member
4 Points
4 Posts
Configuration Error
Nov 27, 2011 04:47 PM|LINK
<configuration> ConnectionString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="d:\DZHosts\LocalUser\thesilvagroup\tsgits.somee.com\database\itss.mdb") Set DbConnection = Server.CreateObject("ADODB.Connection") DbConnection.Open ConnectionString <system.web> <customErrors mode="Off"/> </system.web> </configuration>hans_v
All-Star
35986 Points
6550 Posts
Re: Configuration Error
Nov 27, 2011 09:10 PM|LINK
No.
http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NET
http://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access
eric.silva
Member
4 Points
4 Posts
Re: Configuration Error
Nov 28, 2011 02:51 AM|LINK
Ok. I'm sorry I am still a beginner, I looked at the pages you posted so how would it be setup?
hans_v
All-Star
35986 Points
6550 Posts
Re: Configuration Error
Nov 28, 2011 08:39 AM|LINK
I think you should read them again....
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Configuration Error
Nov 29, 2011 12:46 AM|LINK
Sorry you are definately wrong。 You CANNOT write any C# or Visual Basic codes there。
You should do something like this following in the web.config:Here's a full complete xml contents,and you can refer to the bold one:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="Your Connection Name here" connectionString="Your connection string here" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<system.webServer>
<defaultDocument>
<files>
<add value="WebForm1.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
For more about Access's db connection string, please have a look at this Connection String Searching web site at:
http://www.connectionstrings.com/
eric.silva
Member
4 Points
4 Posts
Re: Configuration Error
Dec 01, 2011 01:59 AM|LINK
@ Decker Dong-MSFT:
I'm sorry I still don't understand would it look like the web.config code below? When I launch the application I recieve the following error:
"Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/authentication/new_user_form.asp, line 130"
LINE 129: set conn_buildings = Server.CreateObject("ADODB.Recordset")LINE 130: conn_buildings.ActiveConnection = MM_conn_itss_STRING
<?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrings> <add name="itss" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\DZHosts\LocalUser\thesilvagroup\tsgits.somee.com\database\itss.mdb" /> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation> </system.web> </configuration>Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Configuration Error
Dec 01, 2011 02:09 AM|LINK
Hello:)
Suspecting whether you've installed OleDb driver successfully?Please re-install it and have a try:
http://www.microsoft.com/download/en/details.aspx?id=13255
hans_v
All-Star
35986 Points
6550 Posts
Re: Configuration Error
Dec 01, 2011 08:02 AM|LINK
The link you provided is dealing with the new ACE driver, which is needed for .accdb (access 2007 and above) files only. The oledb 4.0 driver is installed by default on any windows system. But this is not the problem at all!
You're mixing up classic asp (.asp) and ASP.NET (.aspx). The connectionstring section in web.config is part of ASP.NET, but you're writing a classic asp page. So what do you want? If you want to learn classic ASP, you'll need to ask your questions elsewehere, since these forums are dealing with ASP.NET related questions only. If you want to learn ASP.NET, go to the Get Started section in this website and start at the beginning
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Configuration Error
Dec 01, 2011 08:08 AM|LINK
Hello:)
In my mind, it has included *.mdb——From the file I saw——
Overview
This download will install a set of components that facilitate the transfer
of data between existing Microsoft Office files such as Microsoft Office Access
2010 (*.mdb and *.accdb) files and Microsoft Office Excel 2010 (*.xls, *.xlsx,
and *.xlsb) files to other data sources such as Microsoft SQL Server.
Correct me If I took you wrong kindly.
Best reguards!
hans_v
All-Star
35986 Points
6550 Posts
Re: Configuration Error
Dec 01, 2011 08:15 AM|LINK
Decker, you can connect to mdb files with the new ACE driver also, but that isn't necessary at all, because the oledb 4.0 driver can do that. In his connection string he's not even using the ACE driver, so how could you think this would be the problem?
But you didn't read the next part of my reply! Whatever connectionstring or driver he would use, it will not work when mixing classic ASP and ASP.NET.