?
Solved

Is "microsoft.jet.oledb.4.0" a valid provider to open an Access database

Posted on 2007-04-03
11
Medium Priority
?
1,456 Views
Last Modified: 2009-07-29
Is this a valid provider to open an Access database under Vista from an ASP program on LocalHost?

cn.provider = "microsoft.jet.oledb.4.0"

Here's the code I'm trying to run:

' demonstrate that the folder allows read / write:
Dim a, fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Response.Write "Before fso.CopyFile <BR>"
fso.CopyFile "c:\tempx\testfile.txt", "c:\tempx\testfile_sav.txt"
Response.Write "After fso.CopyFile <BR>"

' Now, try to open the database:
dim cn, dbname
dbname = "C:\tempx\op.mdb"
set cn = server.createobject("ADODB.Connection")
cn.provider = "microsoft.jet.oledb.4.0"
cn.properties("data source") = dbname
Response.Write "Here 1 <BR>"
cn.open
Response.Write "Here 2 <BR>"
Response.End

*** Here are the results of running the code:

Before fso.CopyFile
After fso.CopyFile
Here 1

Microsoft JET Database Engine error '80004005'
Unspecified error
/kiosk/ASPtest.asp, line 15

*** end results

The fso.FileCopy works fine. It error occurs on Line 15 which is the cn.open statement.

0
Comment
Question by:lee88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 18843048
the provider is valid ... here is a line I use in VBA for a connection string, should work fine in vbscript
    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & SourcePath & ";User Id=admin;Password="

the User ID and Password name=Value pairs should not really be necessary but try adding them in.

You will also need permissions to create a file and to modify a file in that folder.

Steve
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18843071

try change
cn.open
to
cn.Open "Data Source=C:\tempx\op.mdb"
0
 

Author Comment

by:lee88
ID: 18844057
Thanks for the suggestions, but
stevbe: I tried your connection string. Same error.
stevbe: I have added full permission for everyone and anonymous for the folder containing the mdb, as well as the folder pointed to by the TEMP environment variable.
capricorn1: I tried your connection string. Same error.

0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18844102

try this

dim cn, dbname,sconn
dbname =server.MapPath("C:\tempx\op.mdb")
sconn="provider = "microsoft.jet.oledb.4.0=" & dbname
set cn = server.createobject("ADODB.Connection")

cn.open sconn
0
 

Author Comment

by:lee88
ID: 18844332
capricorn1: Here's the code I just tried:

dim cn, dbname,sconn
dbname =server.MapPath("C:\tempx\op.mdb")
sconn="provider = microsoft.jet.oledb.4.0=" & dbname
set cn = server.createobject("ADODB.Connection")
Response.Write "Here 1 <BR>"
cn.open sconn
Response.Write "Here 1 <BR>"

Here's the result:

Server.MapPath() error 'ASP 0172 : 80004005'
Invalid Path
/kiosk/ASPtest.asp, line 3
The Path parameter for the MapPath method must be a virtual path. A physical path was used.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18844455
i think you need to place your db in the same folder as your asp page.
0
 

Author Comment

by:lee88
ID: 18844565
may be getting somewhere...
I copied the mdb to the folder where the asp page is. Here's the code:

dim cn, dbname,sconn
dbname = server.MapPath("op.mdb")
sconn="provider = microsoft.jet.oledb.4.0=" & dbname
set cn = server.createobject("ADODB.Connection")
cn.provider = "microsoft.jet.oledb.4.0"
Response.Write "Here 1 <BR>"
cn.open sconn
Response.Write "Here 1 <BR>"

Here's the result:

Here 1
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.
/kiosk/ASPtest.asp, line 8

How do I know if the provider is installer?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18844598
see this link to assist you in setting your asp/iis

http://www.webwizguide.com/asp/tutorials/default.asp
0
 

Author Comment

by:lee88
ID: 19138272
The problem is not solved. I cannot figure out how to install Jet drivers under Vista.
0
 
LVL 44

Expert Comment

by:zephyr_hex (Megan)
ID: 21073719
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
PAQ-Refund

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

zephyr_hex Experts Exchange Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21101998
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

752 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