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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Aceess Page connection on a hosting comany's server

Status
Not open for further replies.
Jan 21, 2005
46
US
Hi. I've been strugling with this for days. I've created DAPs which are hosted in a hosting company's server, and they work fine when I set database connection to my local computer.

But when I set connectionString to "\\lumbergu\ I think is the correct path) in MS Script editor, it gives the error that it cannot open the database.

Following is the connection string suggestion by the hosting company:
<%
Dim DBPath,objRS,objConn

'----------------------------------------------------
'DO NOT MODIFY ABOVE THIS LINE
'----------------------------------------------------


' Change the path below to the actual location of your mdb file
DBPath="/db/file.mdb"


'----------------------------------------------------
'DO NOT MODIFY BELOW THIS LINE
'----------------------------------------------------

Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.mappath(DBPath)
objConn.Open
Set objRS=Server.CreateObject("ADODB.Recordset")

%>

I'm not much familiar with database connection strings, and now I'm desperate to get some help. Thanks in advance.
 
You have a mappath as part of the connection string, so you probably need a much shorter location. Say this is your set up:
[tt]DirectoryForDatabase
File.mdb
DirectoryForPages
PageWithConnection.asp[/tt]

You would say :
[tt]DBPath = "..\DirectoryForDatabase\File.mdb"[/tt]
 
Thanks for your post, Remou. I tried the path you suggested, but it didn't work. The actual place that I put the path is in Microsoft scrip editor, and the part of the code looks like this:

<a:ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=\ Deny None;Extended Properties=&amp;quot;&amp;quot;;Persist Security Info=False;Jet OLEDB:System database=&amp;quot;&amp;quot;;Jet OLEDB:Registry Path=&amp;quot;&amp;quot;;Jet OLEDB:Database Password=&amp;quot;&amp;quot;;Jet OLEDB:Engine Type=0;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=&amp;quot;&amp;quot;;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False</a:ConnectionString>&#13;&#10;
 
So, from the above, you have put the database in a directory \ You need a mappath, I think. I do not know how the connection string you have works with variables, but the data provided by the provider would work like this:

[tt]DBPath=[blue]"/wwwroot/BNH_OrderManagement.mdb"[/blue]

'----------------------------------------------------
'DO NOT MODIFY BELOW THIS LINE
'----------------------------------------------------

Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & [blue]Server.mappath(DBPath)[/blue]
objConn.Open
Set objRS=Server.CreateObject("ADODB.Recordset")[/tt]
 
I found this elsewhere:
<a:ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;DATA SOURCE= & Server.MapPath("/access_db/dailyreport.mdb"); <...></a:ConnectionString>

So I guess:
<a:ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=[blue] & Server.MapPath ("/wwwRoot/BNH_OrderManagement.mdb")[/blue];Mode=Share Deny None;Extended Properties=&amp;quot;&amp;quot;;Persist Security Info=False;Jet OLEDB:System database=&amp;quot;&amp;quot;;Jet OLEDB:Registry Path=&amp;quot;&amp;quot;;Jet OLEDB:Database Password=&amp;quot;&amp;quot;;Jet OLEDB:Engine Type=0;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=&amp;quot;&amp;quot;;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False</a:ConnectionString>&#13;&#10;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top