Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble with web.config file

Status
Not open for further replies.

Techwarrior

Programmer
Apr 19, 2006
14
US
I am having problems getting my ASP.NET files to work on my company’s server. I know that they work because I ran them on a separate server but when I upload it to the company server I get a problem with the web.config file and the <connectionStrings> section. When I removed the <connectionStrings> from the web.config file my test page worked ok but as soon as I added the <connectionStrings> to the web.config file I get an error. Even if I just put <connectionStrings/>. I can’t even tell what the error is because I get the standard runtime error even when I got the <customErrors> turned off. I believe it has to do with not being able to find the database. I ran <%Server.MapPath(“/”)%> and got “c:\inetpub\ as the root folder.

Here is my web.config file:
---------------------
<?xml version="1.0" encoding="utf-8" ?>

<configuration>
<appSettings/>
<connectionStrings>
<add name="DataConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\ providerName="System.Data.OleDb"/>
</connectionStrings>



<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
-------------------
 
I believe your web.config file should look like this:

Code:
<?xml version="1.0" encoding="utf-8" ?>

<configuration>
    <appSettings\>
       <connectionStrings>
           <add name="DataConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\[URL unfurl="true"]wwwroot\Data.mdb;User[/URL] Id=yourid[b];Password=yourpassword;[/b]" providerName="System.Data.OleDb"/>
    </connectionStrings>
 
Is the database located at that location on the server?

Does the application have the appropriate permissions to access that folder on the server (adn teh file itsself?

K
 
You probably need to check what version of asp.net that website is running under IIS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top