[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-04-03
11
Medium Priority
?
1,461 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
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 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