Solved

Relative path to my database on ipower...

Posted on 2006-07-21
7
319 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Html Table looping 4 42
Set time on Session (ASP) 14 36
MS SQL + date 6 53
Two decimal 5 43
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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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