Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with OLEDB connection string with password in ASP

Status
Not open for further replies.

jonathanfrascella

Programmer
Sep 25, 2002
11
GB
Apologies if this should be in an ASP forum, I wasn't sure so I tossed a coin and "Access Other.." won.

I've got an Access DB which I'm trying to connect to via an ASP page. The DB has a password, but no username and opens fine locally - it prompts me for a password, then opens the DB.

When I use the following connection string I get a "Could not find installable ISAM" error.

Code:
<%
Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
strConn = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & Server.MapPath(&quot;data/myDB.mdb&quot;) & &quot;;UID=;PWD=myPassword&quot;
oConn.Open strConn
%>

I've updated both the server and my client machines to run MDAC 2.7 and everything else runs fine. I can connect to a copy of the same DB with the password removed, but for my purposes I need to connect to the protected version.
 
hi there,

try this: use &quot;Jet OLEDB:Database Password=&quot; instead of &quot;pwd=&quot;

Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
strConn = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & Server.MapPath(&quot;data/myDB.mdb&quot;) & &quot;Jet OLEDB:Database Password=myPassword&quot;
oConn.Open strConn

In the past this message has caused me a number of hours of frustration...The error message you are getting (to me) seems to be a generic one. For example, some people have reported this message when they put 'DataSource' instead of 'Data Source' (spelling mistake). Other times, it occur when you specify the wrong data provider in the connection string. Other times, its a MS bug (e.g. search MSDN).

Does this help?

Cheers,
Dan


P.S. A good site on connection strings OLE DB providers is:
 
Excellent - that code snippet was spot on.

Before you replied, I tried changing &quot;PWD=&quot; to &quot;Password=&quot; which gave an alternative error, but that's irrelevant now, thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top