Solved

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

Posted on 2007-04-03
11
1,450 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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 42

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

831 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