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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

relinking tables from mdb file that is password protected using ADO

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
0
0
US
I am trying to relink tables from an remote mdb file that is password protected using ADO. I've tried:
Code:
const cOLEDB as string="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
...
...
For Each tbl In cat.Tables
        'don't bother relinking tmp objects
        If Left$(tbl.name, 1) <> &quot;~&quot; Then
            If tbl.Type = &quot;LINK&quot; Then
                tbl.Properties(&quot;Jet OLEDB:Link Provider String&quot;) = cOLEDB & &quot;C:\SomeFile.mdb ;PWD=PssWrd&quot;
                tbl.Properties(&quot;Jet OLEDB:Link Datasource&quot;) = &quot;C:\SomeFile.mdb&quot;
            End If
        End If        
Next
I get the infamous ISAM error on the Link Provider string property.

Does anyone know the correction I need to relink the table of a remote mdb file that is password protected?

Thanks,
Rewdee
 
Hi Rewdee,

This one always works for me:

&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & _
&quot;C:\My Documents\Test.mdb;User ID=;Password=;&quot; & _
&quot;Persist Security Info=False&quot;

Bill
 
Thanks Bill for your reply.

I confess I haven't tried your code but I can't see how this code will work because the mdb file is password protected and you can't (as far as I know) link to an mdb file without the password and your code does not use the password.

I believe to provide the password it is the PWD property also or ;Jet OLEDB:Database Password= but I can't seem to get either going.

Anymore suggestions?

Thanks,
Rewdee
 
Hi rewdee,

I don't know what the Password is, so how can I type it in, would defeat the object if I did know it anyway.

Just insert it after Password=.

A little tip, pwd= will not work with ADO.

Bill

 
Thanks again Bill for the reply.

I've tried Password=PssWrd and I get the darn ISAM message. Also according to microsoft documentation (Under the under the &quot;Creating and Modifying Tables&quot; the extra property to set is Link Provider String and the PWD=.

Bill, Have you relinked tables that the remote mdb file is password protected? If so, can you post your code?

Thanks again,
Rewdee
 
Got It. Yipee!!!
Code:
'don't bother relinking tmp objects
If Left$(tbl.name, 1) <> &quot;~&quot; Then
   If tbl.Type = &quot;LINK&quot; Then
       tbl.Properties(&quot;Jet OLEDB:Link Datasource&quot;) = &quot;c:\MyFile.mdb&quot;
       tbl.Properties(&quot;Jet OLEDB:Link Provider String&quot;) = &quot;;PWD=PssWrd&quot;
   End If
End If

Thanks Bill for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top