piyushdabomb
New Member
- Joined
- Aug 15, 2007
- Messages
- 3
I have a macro which uses the opendatabase method to run a "Microsoft Query" .dqy file. Whenever I run the macro, I am prompted for a Username and password in the "Microsoft ODBC for Connect" window where I can then successfully use the SQL information the .dqy file to run my query and return it back to excel.
The issue I am currently have is to bypass the password connection for this .dqy file. What I am trying to do is run this statement:
without having to keep placing in the password. The alternative I tried was to open the connection to the database and then try to open the dqy file, but I am still prompted for a password.
Any thoughts, comments..please let me know. I am looking forward to hearing from you soon!!
The issue I am currently have is to bypass the password connection for this .dqy file. What I am trying to do is run this statement:
Code:
numstuds_total = "SQL Queries for Compliance Report\# of students past due-MDR-PEH-CAPA.dqy"
Set Open_DB2 = Workbooks.OpenDatabase(Filename:="C:\" & numstuds_total)
without having to keep placing in the password. The alternative I tried was to open the connection to the database and then try to open the dqy file, but I am still prompted for a password.
Code:
Dim objConn As ADODB.Connection
Set objConn = New ADODB.Connection
With objConn
.Provider = "msdaora"
.ConnectionString = "DSN=GTMSP;"
.Open "Provider = msdaora; Data Source = GTMSP; User Id = PLATEAU; Password = plateau"
End With
Any thoughts, comments..please let me know. I am looking forward to hearing from you soon!!