Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a query from another database

Status
Not open for further replies.

St0rm

MIS
Oct 19, 2000
23
0
0
GB
I need to run a query from inside a diffrent Access database. any idea.

I know that i should just link to the table and make my own querys but the other database is old and a real mess, somthing i dont want to get involved in. any help please
 
"Old" may be the roadblock. If the db is not the same ver, this may not work, but for ver '95 & '97 you just define the db (Dim ... as database) and instantiate the query (set ...). I have never attempted this except with ver '95 & '97, so I do KNOW that it wouldn't work with the other versions, but Uncle Billy NEEDS to make money, so I suspect that he just let the '95 '97 thing slip through (after all it wasn't a real ugrade anyway).

The alternative would be to (perhaps) make a copy of the "old" ver and attempt to import objects from that into a 'new' ver. If you do it sloooooowly and carefully, you should be able to get the tables and queries to translate nicely. Some code/forms/report things won't do as well.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
both db are 97 so will try and work the code out from their i normal use DoCmd.RunMacro XXX so will take me a some time
Thanks you very much
 
Sorry i'm getting total losted

When i dim the db these is no place to put the path in


Db H:\CCS Report\Daily\Corp call data.mdb
Query Qrypca
 
When i dim the db these is no place to put the path in


Db H:\CCS Report\Daily\Corp call data.mdb
Query Qrypca

Dim dbs as Database
Setdbs = Opendatabase("H:\CCS Report\Daily\Corp call data.mdb
")

Dim ret as Recordset
Set rst = dbs.openrecordset("QryPca")

thereafter, refer to "rst" for the records/fields. there are other approaches - but it depends on what you are doing with the the records.



MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
you also can do
select ... from [full path to database].tableName John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top