How To Get Absolute Path In Javascript

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mhadi

Thread Starter
Joined
Aug 9, 2004
Messages
148
Hi All,
I am developing a solutions for clients to run some webpages. Since there is no webserver the ASP route is a No Go. So I am using Javascript to connect to my database.

The Problem is that the following Connection string
var conn_str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data.mdb";
Search of Data.mdb on the desktop.

I came to know that this requires absolute path i.e
var conn_str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Folder1\Data.mdb";

But the problem is the web pages will be distributed on CD and drive name may differs. Further more if the user copies the pages to the hard disk it may stop working.

I want to know how can I get the absolute path, in ASP we use Server.MapPath but what function to use in javascript only version?

Thanks in advance
mhadi
 
Joined
Dec 26, 2005
Messages
5
I have not tried this on a cd, but it might work

Dim sDataSource
Dim objCon

Sub subConnectionOpen
Set objCon = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
sProviderName = "Microsoft.Jet.OLEDB.4.0"
iCursorType = 1
iLockType = 3
sDataSource = InputBox ("Enter path to DB file Exp: C:\Data\dbCompInfo.mdb")
objCon.Provider = sProviderName
objCon.Properties("Data Source") = sDataSource
objCon.Open
End Sub
 

mhadi

Thread Starter
Joined
Aug 9, 2004
Messages
148
Thanks Alot but I am dealing with such client whose end users cannot even read simple instructions and modify the security settings of the internet explorer. The question is how to get the absolute path Automatically!!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top