Solved

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

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

Expert Comment

by:Rey Obrero
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
 
LVL 119

Expert Comment

by:Rey Obrero
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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 42

Expert Comment

by:zephyr_hex
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now