Configuration Errorhttp://forums.asp.net/t/1743909.aspx/1?Configuration+ErrorThu, 01 Dec 2011 08:20:39 -050017439094703121http://forums.asp.net/p/1743909/4703121.aspx/1?Configuration+ErrorConfiguration Error <pre>I am trying to connect to my Access Database. Is this the correct way my &quot;web.config&quot; should be setup? The error is &quot; Unrecognized element.&quot; and it is referent to Line 1 &quot;&lt;configuration&gt;&quot; All help is appreciated. Thank You.<br><br></pre> <pre class="prettyprint">&lt;configuration&gt; ConnectionString = &quot;PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=&quot;d:\DZHosts\LocalUser\thesilvagroup\tsgits.somee.com\database\itss.mdb&quot;) Set DbConnection = Server.CreateObject(&quot;ADODB.Connection&quot;) DbConnection.Open ConnectionString &lt;system.web&gt; &lt;customErrors mode=&quot;Off&quot;/&gt; &lt;/system.web&gt; &lt;/configuration&gt;</pre> 2011-11-27T16:47:04-05:004703307http://forums.asp.net/p/1743909/4703307.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p>No.</p> <p><a href="http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NET">http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NET</a><br> <a href="http://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access">http://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access</a></p> 2011-11-27T21:10:16-05:004703507http://forums.asp.net/p/1743909/4703507.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p>Ok. I'm sorry I am still a beginner, I looked at the pages you posted so how would it be setup?</p> 2011-11-28T02:51:19-05:004704001http://forums.asp.net/p/1743909/4704001.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>eric.silva</h4> I looked at the pages you posted so how would it be setup?</blockquote> <p></p> <p>I think you should read them again....</p> 2011-11-28T08:39:45-05:004705488http://forums.asp.net/p/1743909/4705488.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>eric.silva</h4> <p></p> <pre>I am trying to connect to my Access Database. Is this the correct way my &quot;web.config&quot; should be setup? The error is &quot; Unrecognized element.&quot; and it is referent to Line 1 &quot;&lt;configuration&gt;&quot; All help is appreciated. Thank You.<br><br></pre> <pre class="prettyprint">&lt;configuration&gt; ConnectionString = &quot;PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=&quot;d:\DZHosts\LocalUser\thesilvagroup\tsgits.somee.com\database\itss.mdb&quot;) Set DbConnection = Server.CreateObject(&quot;ADODB.Connection&quot;) DbConnection.Open ConnectionString &lt;system.web&gt; &lt;customErrors mode=&quot;Off&quot;/&gt; &lt;/system.web&gt; &lt;/configuration&gt;</pre> <p></p> </blockquote> <p></p> <p>Sorry you are definately wrong You CANNOT write any C# or Visual Basic codes there</p> <p>You should do something like this following in the web.configHere's a full complete xml contentsand you can refer to the bold one</p> <p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br> &lt;configuration&gt;<br> &nbsp; &lt;connectionStrings&gt;<br> &nbsp;&nbsp;&nbsp; <span style="text-decoration:underline"><strong>&lt;add name=&quot;Your Connection Name here&quot; connectionString=&quot;Your connection string here&quot; /&gt;</strong></span><br> &nbsp; &lt;/connectionStrings&gt;<br> &nbsp; &lt;system.web&gt;<br> &nbsp;&nbsp;&nbsp; &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.0&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;assemblies&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/assemblies&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/compilation&gt;<br> &nbsp; &lt;/system.web&gt;<br> &nbsp; &lt;system.webServer&gt;<br> &nbsp;&nbsp;&nbsp; &lt;defaultDocument&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;files&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add value=&quot;WebForm1.aspx&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/files&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/defaultDocument&gt;<br> &nbsp; &lt;/system.webServer&gt;<br> &lt;/configuration&gt;</p> <p>For more about Access's db connection string, please have a look at this Connection String Searching web site at</p> <p><a href="http://www.connectionstrings.com/">http://www.connectionstrings.com/</a></p> 2011-11-29T00:46:14-05:004709483http://forums.asp.net/p/1743909/4709483.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p>@ Decker Dong-MSFT:</p> <p>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:</p> <p>&quot;<span face="Arial" size="2" style="font-family:Arial; font-size:x-small">Microsoft OLE DB Provider for ODBC Drivers</span>&nbsp;<span face="Arial" size="2" style="font-family:Arial; font-size:x-small">error '80004005'</span></p> <p><span face="Arial" size="2" style="font-family:Arial; font-size:x-small">[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified</span></p> <p><span face="Arial" size="2" style="font-family:Arial; font-size:x-small">/authentication/new_user_form.asp</span><span face="Arial" size="2" style="font-family:Arial; font-size:x-small">, line 130&quot;</span></p> <p></p> <pre></pre> <pre>LINE 129: set conn_buildings = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br>LINE 130: conn_buildings.ActiveConnection = MM_conn_itss_STRING</pre> <pre class="prettyprint">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;configuration&gt; &lt;connectionStrings&gt; &lt;add name=&quot;itss&quot; connectionString=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\DZHosts\LocalUser\thesilvagroup\tsgits.somee.com\database\itss.mdb&quot; /&gt; &lt;/connectionStrings&gt; &lt;system.web&gt; &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.0&quot;&gt; &lt;assemblies&gt; &lt;add assembly=&quot;System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;/system.web&gt; &lt;/configuration&gt;</pre> 2011-12-01T01:59:47-05:004709493http://forums.asp.net/p/1743909/4709493.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>eric.silva</h4> Data source name not found and no default driver specified</blockquote> <p></p> <p>Hello</p> <p>Suspecting whether you've installed OleDb driver successfullyPlease re-install it and have a try</p> <p><a href="http://www.microsoft.com/download/en/details.aspx?id=13255">http://www.microsoft.com/download/en/details.aspx?id=13255</a></p> 2011-12-01T02:09:15-05:004709983http://forums.asp.net/p/1743909/4709983.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Decker Dong - MSFT</h4> <p></p> <p>Suspecting whether you've installed OleDb driver successfullyPlease re-install it and have a try</p> <p><a href="http://www.microsoft.com/download/en/details.aspx?id=13255">http://www.microsoft.com/download/en/details.aspx?id=13255</a></p> <p></p> </blockquote> <p></p> <p>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!</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>eric.silva</h4> <p></p> <p>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:</p> <p>&quot;<span size="2" face="Arial" style="font-family:Arial; font-size:x-small">Microsoft OLE DB Provider for ODBC Drivers</span> <span size="2" face="Arial" style="font-family:Arial; font-size:x-small">error '80004005'</span></p> <p><span size="2" face="Arial" style="font-family:Arial; font-size:x-small">[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified</span></p> <p><span size="2" face="Arial" style="font-family:Arial; font-size:x-small">/authentication/new_user_form.asp</span><span size="2" face="Arial" style="font-family:Arial; font-size:x-small">, line 130&quot;</span></p> <p></p> </blockquote> <p></p> <p>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 <a href="http://www.asp.net/get-started/" target="_blank">Get Started</a> section in this website and start at the beginning</p> <p>&nbsp;</p> 2011-12-01T08:02:27-05:004709996http://forums.asp.net/p/1743909/4709996.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>hans_v</h4> 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!</blockquote> <p></p> <p>Hello</p> <p>In my mind, it has included *.mdbFrom the file I saw</p> <h2 id="overview">Overview</h2> <p>This download will install a set of components that facilitate the transfer <br> of data between existing Microsoft Office files such as<strong> Microsoft Office Access </strong><br> <strong>2010 (*.mdb and *.accdb)</strong> files and Microsoft Office Excel 2010 (*.xls, *.xlsx, <br> and *.xlsb) files to other data sources such as Microsoft SQL Server.</p> <p>Correct me If I took you wrong kindly.</p> <p>Best reguards</p> 2011-12-01T08:08:26-05:004710012http://forums.asp.net/p/1743909/4710012.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Decker Dong - MSFT</h4> In my mind, it has included *.mdbFrom the file I saw</blockquote> <p></p> <p>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?</p> <p>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.</p> 2011-12-01T08:15:23-05:004710027http://forums.asp.net/p/1743909/4710027.aspx/1?Re+Configuration+ErrorRe: Configuration Error <p></p> <blockquote><span class="icon-blockquote"></span> <h4>hans_v</h4> 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.</blockquote> <p></p> <p>Thanks for telling meand the questioner's codes really wrongBut I have to correct his mistakes one by oneat least I was to do sobut since you began to helpWellThanks</p> <p></p> 2011-12-01T08:20:39-05:00