473,505 Members | 15,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access file path question

I usually use SQL Server, but have occasionally had to use Access. This is
such an occasion. My research, mainly at aspfaq.com, has been that you need
to put the file path in your connection string, like this (watch out for the
wrap):

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydirectoryname\dbname.mdb;User Id=xxxxx;Password=xxxxxxx;"
Well, the host of this new site I am working on is asking me if a relative
path will work. I don't think it will, but thought I should ask.

And please, I know that Access is not a good choice, but it needs to be this
way in this case.
Jul 19 '05 #1
7 1859
"middletree" <mi********@htomail.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
I usually use SQL Server, but have occasionally had to use Access. This is
such an occasion. My research, mainly at aspfaq.com, has been that you need to put the file path in your connection string, like this (watch out for the wrap):

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydirectoryname\dbname.mdb;User Id=xxxxx;Password=xxxxxxx;"
Well, the host of this new site I am working on is asking me if a relative
path will work. I don't think it will, but thought I should ask.


I believe it needs to be a path like the one you listed, but you could also
use the MapPath function to get the full path to the file.
Hope this helps.
Peter Foti
Jul 19 '05 #2
"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message
news:10*************@corp.supernews.com...
"middletree" <mi********@htomail.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
I usually use SQL Server, but have occasionally had to use Access. This is such an occasion. My research, mainly at aspfaq.com, has been that you need
to put the file path in your connection string, like this (watch out for

the
wrap):

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydirectoryname\dbname.mdb;User Id=xxxxx;Password=xxxxxxx;"
Well, the host of this new site I am working on is asking me if a relative path will work. I don't think it will, but thought I should ask.


I believe it needs to be a path like the one you listed, but you could

also use the MapPath function to get the full path to the file.


Meant to include this link:
http://www.devguru.com/Technologies/...r_mappath.html

Regards,
Peter Foti
Jul 19 '05 #3
why don't you use server.mappath???? like below

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="&server.mappath("relativepath")&";User
Id=xxxxx;Password=xxxxxxx;"

relative path may be any relative path of your access db...

!mran Khan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4
On Thu, 11 Mar 2004 13:12:05 -0600, "middletree"
<mi********@htomail.com> wrote:
I usually use SQL Server, but have occasionally had to use Access. This is
such an occasion. My research, mainly at aspfaq.com, has been that you need
to put the file path in your connection string, like this (watch out for the
wrap):

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydirectoryname\dbname.mdb;User Id=xxxxx;Password=xxxxxxx;"
Well, the host of this new site I am working on is asking me if a relative
path will work. I don't think it will, but thought I should ask.
Relative path works, placing the MDB in the same folder (no path)
works and Server.MapPath works. Depending on what your ISP allows and
where the database is located.
And please, I know that Access is not a good choice, but it needs to be this
way in this case.


Access is fine, provided you understand and can live with its
limitations.

Jeff
Jul 19 '05 #5
can't seem to make it work.

Here's my entire code for this include file, and the only thing I changed
here is the ID and password:

strConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&ser ver.mappath("\")"&shape.md
b;User Id=x;Password=x;"

filePath = Server.MapPath("shape.mdb")

I did this because the Access db is in the same folder as the page which
calls it (not the include file, but the page which calls the include)

The error I get now is:
Expected end of statement

/gracearlingtoncom/shape/includes/shapedbinc.asp, line 5

strConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&ser ver.mappath("\")"&shape.md
b;User Id=admin;Password=;"
----------------------------------------------------------------------------
------^In case the wrap is messing things up for you, the arrow is pointing
to the quote mark right after the closing parenthesis.
"Imran Salahuddin Khan" <it***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
why don't you use server.mappath???? like below

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="&server.mappath("relativepath")&";User
Id=xxxxx;Password=xxxxxxx;"

relative path may be any relative path of your access db...

!mran Khan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #6
"middletree" <mi********@htomail.com> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
can't seem to make it work.

Here's my entire code for this include file, and the only thing I changed
here is the ID and password:

strConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&ser ver.mappath("\")"&shape.md b;User Id=x;Password=x;"


Try this:
strConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&ser ver.mappath("\shape.md
b")&";User Id=x;Password=x;"
Regards,
Peter Foti
Jul 19 '05 #7
Looks like it got past that problem. Now, I have to go research what this
means:

Microsoft JET Database Engine error '80004005'
Could not find installable ISAM.

/gracearlingtoncom/shape/list.asp, line 37

thanks


"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message
news:10*************@corp.supernews.com...
Try this:
strConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&ser ver.mappath("\shape.md
b")&";User Id=x;Password=x;"

Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4675
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another...
1
3704
by: Theerachet Pratoommanee | last post by:
This is error message I've got. Any suggestion would be appreciated. Server Error in '/WebDirectory' Application. ----------------------------------------------------------------------------...
7
8822
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
6551
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
0
1485
by: Goran | last post by:
Hi I have created a very simple ASP.Net application that only consists of a CrystalReports Viewer, that has been connected to a .rpt file. When the page is loaded in the browser, the following...
13
2333
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't...
8
9699
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
3
7945
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
7
1955
by: Visitor No 3 | last post by:
My local Crinkles group(U3A), of which I am one, want me to develop a noddy database and web site for their members. Some are computer literate, others not so. I thought an Access 2000 .mdb on a...
6
6989
by: fyitang | last post by:
hi guys, here is the sample: string strFileFullName = ""; try { FileInfo currentFile = GetOneFile("some directory"); strFileFullName = currentFile.FullName; // do someting...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.