Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Three Databases?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Three Databases?

 Post Reply Post Reply Page  12>
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Topic: Three Databases?
    Posted: 10 April 2003 at 5:17pm

Is it possible to open up three databases in the same ASP file (three different variables set to Server.CreateObject("ADO etc...) and then open up a recordset for two of them, and use the SQL statement "INSERT INTO" to put the values from the two other databases into one? I'm wondering, with the insert into statement how does it know which database to insert into, is there another field where you can put the database name and the table name or no?

Thanks,
Paul Morgan

Back to Top
Coco Brown View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2002
Location: United States
Status: Offline
Points: 245
Post Options Post Options   Thanks (0) Thanks(0)   Quote Coco Brown Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2003 at 4:48pm

yes, you can query over two databases, but you have to link them first.  I would import the table you want from one database into another.  Then query normally between the two tables.  Use that info to create your new Insert SQL query and execute it.

As far as opening three connections, you can open up to 10 connections on the same page without getting an error.  But my way would require you to only use two:  the one you are querying from(that has the imported table), and the other one you are inserting into.

Hope this helps.

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2003 at 5:47pm

how do you link the databases?

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2003 at 10:47pm

What database are you using.

You can 'link servers' in SQL Server and I imagine there is something similar in Oracel.

If you are using Access then theres a bit more trouble to go to.

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2003 at 6:36pm
i'm using access 2000
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2003 at 7:32pm

Can the databases see each other?

If so, you can link tables from within the database itself. This will probably impact on performance a little, but might be the easier way.

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2003 at 7:37pm
when you say "see each other" what do you mean?
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2003 at 7:45pm

Generally means the same server or through mapped drives etc.

Try it: Open up one of the databases- Insert -> Table -> Linked Table.

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.