Solved

Relative path to my database on ipower...

Posted on 2006-07-21
7
316 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
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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