Database Query

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?
 
P

Paul D

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
 

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