Excel/Access

G

Guest

Hello,

I am using the following code in VBA Excel to try and
download an Access table. The access table is password
protected and this code is an example of what I have used
in the past. How can I add the password to this code to
allow the table to download correctly?



Set dba = OpenDatabase("C:\fhs\listing\file1.mdb")
Set rst = dba.OpenRecordset("IA", dbOpenDynaset,
dbReadOnly)
Sheets("Form").Select
[a1].CopyFromRecordset rst
 
A

Alex Dybenko

if you mean that database is password-protected - replace to this line:
Set dba = OpenDatabase("C:\fhs\listing\file1.mdb", False, False,
";pwd=MyPassword")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top