Solved

Relative path to my database on ipower...

Posted on 2006-07-21
7
314 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
  • 3
  • 3
7 Comments
 
LVL 26

Expert Comment

by:DireOrbAnt
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 26

Accepted Solution

by:
DireOrbAnt earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now