G
Gsimmons2005
hey guys,
So I have some code to query an external access database and that part
works great. However, in that query, it connects to an oracle databse
in the process and as a results prompts me for a username and password
whenever I run that external query. Is there a way to program in the
queried servers username/pw so I dont get a prompt or is that set on
the access side?
Here is my code now
Thanks
Greg
So I have some code to query an external access database and that part
works great. However, in that query, it connects to an oracle databse
in the process and as a results prompts me for a username and password
whenever I run that external query. Is there a way to program in the
queried servers username/pw so I dont get a prompt or is that set on
the access side?
Here is my code now
Code:
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User
ID=Admin;Data Source=H:\Common\QRMresid\Current Month\Outputs\VTC.mdb;"
_
), Destination:=Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array("VTC Query")
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub
Thanks
Greg