Solved

Relative path to my database on ipower...

Posted on 2006-07-21
7
320 Views
Last Modified: 2012-06-27
I have no idea if being on an ipower server makes any difference. It seems that I've encountered different protocals depending on the ISP. In any case, I hoping there are some common denominators that apply so here's what I've got...

I'm using a Global.asa doc.

Where does it go? Does it go in the wwwroot directory or is it positioned outside that directory? Then, what should the script look like? Here's the way I have it on my C drive...

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
Session("dbConn_ConnectionString") ="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\BSP\Data\Shiny.mdb"
End Sub
</SCRIPT>

How will it look on an ipower?

I appreciate the help...
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17154865
Put your global.asap in your wwwroot directory or any virtual directory you create. Each virtual directory starts it's own ASP space, so you can use a different global.asa per virtual directory. For you, it looks like you need it in your root.
0
 

Author Comment

by:brucegust
ID: 17155571
Does my path need to be anything more than Data/Shiny.mdb provided it's in the root directory?
0
 
LVL 22

Expert Comment

by:WMIF
ID: 17155597
you could just put your connection string in a file and include that file on all the pages instead of using the session object.


db.asp______
<%
Dim connstring
connstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\BSP\Data\Shiny.mdb;"
%>
___________


anypage.asp____
...
<!--#include file="../Connections/db.asp"-->
<%
dim conn
set conn = server.CreateObject("ADODB.connection")
conn.open connstring
...
______________
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 26

Accepted Solution

by:
DireOrbAnt earned 500 total points
ID: 17155678
For the Data Source, you should use server.mappath as in:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/BSP/Data/Shiny.mdb")
0
 

Author Comment

by:brucegust
ID: 17155818
So the code would look like:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
Session("dbConn_ConnectionString") ="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/BSP/Data/Shiny.mdb")
End Sub
</SCRIPT>

The big thing is that I'm not including "C:/Inetpub..." etc because I'm not on my computer, correct? This is for my ISP so I don't need to worry about that. Also, since I'm putting this in my root directory and there isn't a BSP folder, I'm going right to my Data folder, correct?
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17156450
Try this on YOUR computer, it will work too :)
Server.MapPath will map a virtual directory to it's physical location :)
Yes on Data folder so:
Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/Data/Shiny.mdb")

Have you been able to test any of this?
0
 

Author Comment

by:brucegust
ID: 17175639
The ipower protocol had me document the path like this: C:/Accounts/bigshiny/wwwroot/Data/Shiny.mdb. Once that was in place, everything hummed just the way it should.

Thanks for the feedback!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question