943,829 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2947
  • ASP.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Apr 15th, 2009
0

Web Server Path for Access DB

Expand Post »
Hi

I have just uploaded an Access DB and an .aspx page that writes to the DB. It works fine locally ie IIS.

The problem is that when on the host the db does not get written to. I think its to do with the Source to the DB on my web.config file.

The db is on annex2/annex.eu/wwwroot/annexll.mdb on the host
my code on the Web.config is as follows
ASP.NET Syntax (Toggle Plain Text)
  1. <add key="MM_CONNECTION_HANDLER_ss1" value="default_oledb.htm" />
  2. <add key="MM_CONNECTION_STRING_ss1" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=annexeu/annex2.eu/wwwroot/annexll.mdb;Persist Security Info=False" />
  3. <add key="MM_CONNECTION_DATABASETYPE_ss1" value="OleDb" />
  4. <add key="MM_CONNECTION_SCHEMA_ss1" value="" />
  5. <add key="MM_CONNECTION_CATALOG_ss1" value="" />



THanks
Reputation Points: 16
Solved Threads: 0
Light Poster
ViRiPuFF is offline Offline
32 posts
since Jun 2007
Apr 15th, 2009
0

Re: Web Server Path for Access DB

You should check with your provider with regards to security.

Your not passing any security information in your string (i.e. username and password) and i would have thought that your provider would require this.
Reputation Points: 22
Solved Threads: 9
Junior Poster
ninjaimp is offline Offline
129 posts
since Apr 2008
Apr 15th, 2009
0

Re: Web Server Path for Access DB

Thanks for your help, I'll try to get this from my ISP

ViRiPuff
Reputation Points: 16
Solved Threads: 0
Light Poster
ViRiPuFF is offline Offline
32 posts
since Jun 2007
Apr 15th, 2009
1

Re: Web Server Path for Access DB

no worries - let me know how you get on
Reputation Points: 22
Solved Threads: 9
Junior Poster
ninjaimp is offline Offline
129 posts
since Apr 2008
Apr 15th, 2009
0

Re: Web Server Path for Access DB

The ISP gave me the path C:\HostingSites\Annexeu\Annex2 they said nothing about security.

This is what I've tried since

In my Web.Config
ASP.NET Syntax (Toggle Plain Text)
  1. <configuration>
  2.  
  3. <system.web>
  4. <customErrors mode="On"/>
  5. </system.web>
  6.  
  7. <appSettings>
  8.  
  9. <add key="MM_CONNECTION_HANDLER_ss1" value="default_oledb.htm" />
  10. <add key="MM_CONNECTION_STRING_ss1" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}\db\AnnexII.mdb;" />
  11.  
  12. <add key="MM_CONNECTION_DATABASETYPE_ss1" value="OleDb" />
  13. <add key="MM_CONNECTION_SCHEMA_ss1" value="" />
  14. <add key="MM_CONNECTION_CATALOG_ss1" value="" />
  15.  
  16.  
  17. </appSettings>
  18. </configuration>

In my Returns.aspx file on Page load
ASP.NET Syntax (Toggle Plain Text)
  1. Sub Page_Load()
  2. Dim connstr
  3.  
  4. connstr = String.Format(ConfigurationManager.AppSettings("MM_CONNECTION_STRING_ss1"), Server.MapPath("~"))
  5. End Sub

But it still writes nothing into the Access DB. Nevertheless there no errors coming up which is strange. No errors so I have nothing to go on

ViRiPuff
Reputation Points: 16
Solved Threads: 0
Light Poster
ViRiPuFF is offline Offline
32 posts
since Jun 2007
Apr 15th, 2009
0

Re: Web Server Path for Access DB

just try this connection string in your code first and try something like this:

ASP.NET Syntax (Toggle Plain Text)
  1. connstr = "Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("AnnexII.mdb")""

This is presuming that the DB is in the root file on your web server.

Also, What is the code you are using to write values to the database?
Last edited by peter_budo; Apr 18th, 2009 at 4:41 am. Reason: Correcting closing tag
Reputation Points: 22
Solved Threads: 9
Junior Poster
ninjaimp is offline Offline
129 posts
since Apr 2008
Apr 15th, 2009
0

Re: Web Server Path for Access DB

Hi

Thanks again for your help. I created the site with Dreamweaver 8 and here's the INSERT code

ASP.NET Syntax (Toggle Plain Text)
  1. <MM:Insert
  2. runat="server"
  3. CommandText='<%# "INSERT INTO Returns (AccessCode, CallSign, Delivering, DepDate, Email, ETADate, Flag, GrossTons, IMOno, LastDelDate, LastDelPort, NextPort, NoticeDate, NoticeTime, PreviousPort, Q35, VesselName) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" %>'


I'll try your suggestion now. I'll report back in a few minutes
Last edited by peter_budo; Apr 18th, 2009 at 4:42 am. Reason: Correcting closing tag
Reputation Points: 16
Solved Threads: 0
Light Poster
ViRiPuFF is offline Offline
32 posts
since Jun 2007
Apr 15th, 2009
0

Re: Web Server Path for Access DB

Hi I tried your suggestion and I get the following error
Compiler Error Message: BC30205: End of statement expected.

ViRiPuff
Reputation Points: 16
Solved Threads: 0
Light Poster
ViRiPuFF is offline Offline
32 posts
since Jun 2007
Apr 15th, 2009
0

Re: Web Server Path for Access DB

Hi again

I've gone back to the path my isp gave me on the Web.config. Its now opening the database but not writing to it.

I know this because when I view the DB using my ftp immediately after trying to write to it from the web the db is locked for about 5 minutes. After about 5 minutes the db is viewable again but no data has been written to it.

Here is the path from the isp
C:\HostingSpaces\annexeu\annex2.eu\wwwroot

ViRiPuff
Reputation Points: 16
Solved Threads: 0
Light Poster
ViRiPuFF is offline Offline
32 posts
since Jun 2007
Apr 15th, 2009
0

Re: Web Server Path for Access DB

what line of your code is the error on?
Reputation Points: 22
Solved Threads: 9
Junior Poster
ninjaimp is offline Offline
129 posts
since Apr 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Manipulate asp:label through ul/li
Next Thread in ASP.NET Forum Timeline: Javascript_urgent





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC