[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

problems connecting to db

Posted on 2006-05-09
14
Medium Priority
?
317 Views
Last Modified: 2008-02-01
Built some ASP pages (the last 2 links at http://olympiapbia.org) that connect to an Access db.  They work fine on a previous server but have moved them to their present location and am having problems with the db connectivity.  Hosting company isn't much help.  Here's the code (and error msgs):

DataConn.Open "DBQ=" & Server.Mappath("xxxxx.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" gives the error msg
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x6f4 Thread 0x918 DBC 0x22a3ffc Jet'.

so I tried

DataConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../xxxxxx.mdb") whcih gives
Server.MapPath() error 'ASP 0172 : 80004005'
Invalid Path
The Path parameter for the MapPath method must be a virtual path. A physical path was used.

I know the server is running MDAC v2.7 SP1 and IUSR is supposed to have read/write capabilities to this directory.

Any suggestions?
0
Comment
Question by:KenAdney
  • 3
  • 3
  • 2
  • +5
13 Comments
 
LVL 13

Expert Comment

by:jmundsack
ID: 16642082
Could it be that .MapPath wants just the path, not the .mdb file?
0
 
LVL 6

Expert Comment

by:rockymagee
ID: 16642113
Give this a shot:

Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("XXXXX.mdb")
MyConn.Mode = 3
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"

' SQL QUERY
SQL_query = "SELECT * FROM yourTable"
Set RS = MyConn.Execute(SQL_query)
WHILE NOT RS.EOF
' *******************************
' *******************************
RS.MoveNext
MyConn.close
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 16642182
If your host is using IIS6 then parent paths (i.e. using .. in the path) is disabled by default. Your best bet, if you can't get your host to enable parent paths, is to provide the virtual path to the DB.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 16642290
Do a Response.Write(Server.Mappath("xxxxx.mdb")) to make sure it is the correct path.

It can also be permission problem on the TEMP folder, so make sure your IUSR account has read/write permissions on the temp folder.  Make sure they also have permissions to the actual mdb file and not just the directory.
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 16642309
Here are some instructions to set the permissions for your TEMP folder:

   1. Open the Windows (file) Explorer.
   2. Find the \WINNT\Temp directory.
   3. Right click and select "Temp Properties".
   4. In the resulting panel click on the "Security" tab.
   5. Now click the "Add" button.
   6. In the new "Select Users ..." panel (the top list box) select the user entity whose first 5 characters are "IUSR_", which is the Internet Guest User.
   7. (After adding the IUSR you will be back in the "Security" tab in "Temp Properties" panel.)
   8. In the "Permissions" box allow only List Folder Contents, Read, and Write permissions.
   9. It also very important to click the checkbox saying "Allow inheritable from parent to propagate this object".
0
 
LVL 12

Expert Comment

by:Preece
ID: 16643448
Don't know if it will help, but try this:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../xxxxxx.mdb"

Preece
0
 
LVL 13

Expert Comment

by:nurbek
ID: 16645982
try this

DataConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("xxxxxx.mdb")
0
 
LVL 10

Author Comment

by:KenAdney
ID: 16649615
Thanks one & all...I've upped the points a bit.

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../xxxxxx.mdb" and the more complete DataConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("xxxxxx.mdb") gives
Microsoft JET Database Engine error '80004005'
Unspecified error

Response.Write(Server.Mappath("xxxxx.mdb")) reports e:\www\olympiapbia\xxxxx.mdb but I don't know what to do that.  If I change Server.Mappath("xxxx.mdb") to Server.Mappath("e:\www etc.") I get the same "Path parameter for the MapPath method must be a virtual path" error.

rockymagee's coding gives me the "Unable to open registry key"  error.

I'll contact the hosting company about write permissions for the file and the temp folder.
0
 
LVL 12

Expert Comment

by:Preece
ID: 16694975
Give this a try:

DataConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../xxxxxx.mdb"

Preece
0
 
LVL 12

Expert Comment

by:Preece
ID: 16719348
Oh, didn't see that you had tried that before my last post...

Preece
0
 
LVL 10

Author Comment

by:KenAdney
ID: 16753861
If there's no refund of the points, just split 'em up between those who offered solutions...even though none were truly effective.  I appreciate everyone's help.
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 16756882
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16778457
Closed, 250 points refunded.

GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 informatio…
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 lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses

873 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