Solved

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

Posted on 2007-04-03
11
1,454 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
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

 
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 43

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

707 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