MS Access With Password

G

gatarossi

Dear all

I have a VBA code in excel that do querys in my MS Access Database,
but I put a password in my database.

Then I have some dificult to inform the password in my vba code:

Sub del_cust_model()

Dim wrkSpace As DAO.Workspace
Dim db As DAO.Database
Dim qryDef As DAO.QueryDef
Dim qryNome As String
Dim strSQL As String
Dim strDB As String

'On Error Resume Next
strDB = ThisWorkbook.Path & "\bd_dynamic_query.mdb"

Set wrkSpace = Workspaces(0)
Set db = wrkSpace.OpenDatabase(strDB)
qryNome = "qryDelete"

db.QueryDefs.Delete qryNome

strSQL = "DELETE aux_cust_model.* FROM aux_cust_model "

Set qryDef = db.CreateQueryDef(qryNome, strSQL)

qryDef.Execute

End Sub

Where can I inform the password?

Thanks in advance!!!!

André.
 

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