locked
Configuration Error RRS feed

  • Question

  • User-1834631092 posted
    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.

    <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>
    Sunday, November 27, 2011 12:47 PM

Answers

  • User-1199946673 posted

    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

    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!

    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"

    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

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 1, 2011 4:02 AM

All replies

  • User-1834631092 posted

    Ok. I'm sorry I am still a beginner, I looked at the pages you posted so how would it be setup?

    Sunday, November 27, 2011 10:51 PM
  • User-1199946673 posted

    I looked at the pages you posted so how would it be setup?

    I think you should read them again....

    Monday, November 28, 2011 4:39 AM
  • User3866881 posted

    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.

    <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>

    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/

    Monday, November 28, 2011 8:46 PM
  • User-1834631092 posted

    @ 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>
    Wednesday, November 30, 2011 9:59 PM
  • User3866881 posted

    Data source name not found and no default driver specified

    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

    Wednesday, November 30, 2011 10:09 PM
  • User-1199946673 posted

    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

    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!

    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"

    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

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 1, 2011 4:02 AM
  • User3866881 posted

    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.

    Correct me If I took you wrong kindly.

    Best reguards!

    Thursday, December 1, 2011 4:08 AM
  • User-1199946673 posted

    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.

    Thursday, December 1, 2011 4:15 AM
  • User3866881 posted

    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.

    Thanks for telling me,and the questioner's codes really wrong……But I have to correct his mistakes one by one(at least I was to do so……),but since you began to help……Well……Thanks!

    :)

    Thursday, December 1, 2011 4:20 AM