Running MS Access Queries from Excel - How to Encrypt Credentials

Striker1234

New Member
Joined
Dec 12, 2015
Messages
9
Hi,

I am trying to run an MS Access queries from Excel but when I try to run the from Excel, it always asks for a password. I would like to remove the prompts / embed credentials so macro would run without any interruptions.

Thanks in advance!

AQuery is an Append Query that goes to ATable

Rich (BB code):
Dim db As ADODB.Connection Dim cmd As New ADODB.Command Dim dbPath As String Dim AQuery As String Dim ATable As String Dim WS As Worksheet ThisTemplate = ThisWorkbook.Name dbPath = Range("G10") AQuery = Range("G11") ATable = Range("G12") 'RunQuery Set db = New ADODB.Connection db.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbPath & ";" cmd.CommandType = adCmdStoredProc cmd.CommandText = AQuery cmd.ActiveConnection = db db.Execute "DELETE * FROM " & ATable, FailonError db.Execute AQuery, FailonError 'Macro stops here and asks for ODBC Oracle Driver Connect Credentials
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top