Database Query

  • Thread starter Thread starter leslie
  • Start date Start date
L

leslie

I recently moved an access database from one network
drive to another. I have an excel database query to that
database that no longer works. Do I have to somehow
update the query to look at the new location of the
database? How?
 
I'm assuming since you posted this in the programming group, you are doing
this query from a macro. So my next assumption is you have something along
this in the code.

Set cnnDB = New ADODB.Connection
With cnnDB
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Mode = adModeRead
.Properties("Jet OLEDB:Database Password") = ****
.Open "old_database_location_here"
Set myrs = New ADODB.Recordset
Set myrs = cnnDB.Execute(MySql)
End With

if this is the case, just change the string after the open command to the
location of the new database.
Paul D
 
Back
Top