Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
How To Get Absolute Path In Javascript


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
mhadi's Avatar
Senior Member with 148 posts.
 
Join Date: Aug 2004
Location: 21°26' N 39°49' E
Experience: Pushing Backward the frontiers;Duh from which side
26-Dec-2005, 04:48 AM #1
Question How To Get Absolute Path In Javascript
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
Arkur55's Avatar
Junior Member with 5 posts.
 
Join Date: Dec 2005
Experience: Advanced
26-Dec-2005, 03:01 PM #2
Try to use an input Box.
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's Avatar
Senior Member with 148 posts.
 
Join Date: Aug 2004
Location: 21°26' N 39°49' E
Experience: Pushing Backward the frontiers;Duh from which side
30-Dec-2005, 01:39 PM #3
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!!
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:00 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.