Web Server Path for Access DB

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2007
Posts: 26
Reputation: ViRiPuFF is an unknown quantity at this point 
Solved Threads: 0
ViRiPuFF ViRiPuFF is offline Offline
Light Poster

Web Server Path for Access DB

 
0
  #1
Apr 15th, 2009
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
  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
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

Re: Web Server Path for Access DB

 
0
  #2
Apr 15th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 26
Reputation: ViRiPuFF is an unknown quantity at this point 
Solved Threads: 0
ViRiPuFF ViRiPuFF is offline Offline
Light Poster

Re: Web Server Path for Access DB

 
0
  #3
Apr 15th, 2009
Thanks for your help, I'll try to get this from my ISP

ViRiPuff
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

Re: Web Server Path for Access DB

 
1
  #4
Apr 15th, 2009
no worries - let me know how you get on
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 26
Reputation: ViRiPuFF is an unknown quantity at this point 
Solved Threads: 0
ViRiPuFF ViRiPuFF is offline Offline
Light Poster

Re: Web Server Path for Access DB

 
0
  #5
Apr 15th, 2009
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
  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
  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
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

Re: Web Server Path for Access DB

 
0
  #6
Apr 15th, 2009
just try this connection string in your code first and try something like this:

  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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 26
Reputation: ViRiPuFF is an unknown quantity at this point 
Solved Threads: 0
ViRiPuFF ViRiPuFF is offline Offline
Light Poster

Re: Web Server Path for Access DB

 
0
  #7
Apr 15th, 2009
Hi

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

  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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 26
Reputation: ViRiPuFF is an unknown quantity at this point 
Solved Threads: 0
ViRiPuFF ViRiPuFF is offline Offline
Light Poster

Re: Web Server Path for Access DB

 
0
  #8
Apr 15th, 2009
Hi I tried your suggestion and I get the following error
Compiler Error Message: BC30205: End of statement expected.

ViRiPuff
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 26
Reputation: ViRiPuFF is an unknown quantity at this point 
Solved Threads: 0
ViRiPuFF ViRiPuFF is offline Offline
Light Poster

Re: Web Server Path for Access DB

 
0
  #9
Apr 15th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 115
Reputation: ninjaimp is an unknown quantity at this point 
Solved Threads: 6
ninjaimp ninjaimp is offline Offline
Junior Poster

Re: Web Server Path for Access DB

 
0
  #10
Apr 15th, 2009
what line of your code is the error on?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC