I pasted your code in a spreadsheet, created the database. It does not like "Dir"because that is a reserved word to refer to a directory. Can you change that to something els elike "myDir" just to see if the error still occurs?
From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On Behalf Of danielalmeida50
Sent: Tuesday, July 16, 2013 5:52 AM
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] Access connection using VBA Excel - code. accuses Invalid Password
Hy,
I have a code that do not work because it accuses invalid password despite I'm using the correct password
Look the code:
Dir = ActiveWorkbook.Path
Myconn = Dir & "\RH_Access.accdb"
'Faz a conexão com o banco de dados
Set cnn = New ADODB.Connection
With cnn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Properties("data source") = Myconn
.Properties("User ID") = "Admin"
.Properties("Jet OLEDB:Database Password") = "daniel"
.Open
End With
Can somebody help me to make it work please?
Daniel
[Non-text portions of this message have been removed]
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar