Originally Posted by
Kenneth Hobs
You have several issues with that code. Where is your Open?
I was trying to modify the code you posted above to work. I thougth my open was the sOpen statement? Now looking at the code I have posted, I am trying to run a query then open a database, which wouldn't work. I would need the sOpen statement to come 1st.
Originally Posted by
Kenneth Hobs
Where is your Execute?
The execute...I had been using
Sheets(2).Rows(3).CopyFromRecordset .DataSource
To run the query, that gave it location as well as copied in the data, I was hoping something similar would work in this scenario, but it doesn't look like it is going to. I will try a modification to my code of:
For q = LBound(uRp) To UBound(uRp)
sOpen = "Driver={Microsoft Access Driver (*.mdb)};Dbq=R:\" & uRp(q) & "\\" & uRp(q) & "_test.mdb;"
For Each qq In qryName()
'//telling Excel where to copy the data to and where to copy from
Sheets(2).Rows(3).Select
sExecute
Next qq
Next q
'//Close the connection
s.Close
As far as the SQL Server goes, the tables are housed in SQL Server but linked into an access database, that's why I was just trying to run an access query that will update the linked table.