 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 9th, 2004, 03:15 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
multiple database connections
hi
I have an online application that is currently being upgraded, the problem is that before i had all my files in a single database but now i have to connect to at least 2 but most likely 3 databases as i am linking into another system. there is no was to integrate the databases into one so it is up to me to make the changes to my code. i was wondering if there are any reasons why i cannot connect to 2,3 or more databases at one time? database is visual foxpro.
Slán
~M
____
Mark
|
|

September 9th, 2004, 04:00 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am not sure how to do it for foxpro, but you can certainly connect to many DBs located in multiple servers, local server. If local server, you can simply add a new form where you will have all the connections declared, then use a stored procedure and connect to the database depending upon the relations. If on remote server, you can use linked_servers.
Regards
sinapra
|
|

September 9th, 2004, 04:19 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
AS for as the databse connection is concern you can made them in one page and the matter is thing that you mention the name of the databse at making the connection between with the database
(*_*)
Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
|
|

September 9th, 2004, 04:25 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yes db.table...... that could be a way if your dbs are in same server
sinapra
|
|

September 9th, 2004, 04:57 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
sorry i should provide more information although i think that from what you are all saying this should not be a problem. i have about 60-70 asp pages all linking into the database. i have one page, connect.asp, that contains the connection string and i include this at the top of all pages. i want to include 2 or 3 connection strings in this file and still be able to connect to any table/database on the 60-70 pages at any time. what has me confused it that should i have to close the connection to db1 before trying to access bd2 or can they all be open at the same time? all databases will be on the same machine but they will be in different folders and different drives.
Slán
~M
____
Mark
|
|

September 9th, 2004, 05:07 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hey Mark,
Do you mean to joining different DBFs(tables) from different databases?
Though I am not so good at visual foxpro(having worked with older versions of foxpro), I would suggest you to read about Views. You could get that to work using views. Check msdn on views. That should help you.
Working with Views
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

September 9th, 2004, 05:09 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Its always a good practice to close the connections, that is, if you are using two different DBs means you need to open both of them seperately. After the output is given, you must close the connections in order as they execute. So connect.asp will only have connection strings and connections are made open in all the subsequent pages that make the call to connection string. I hope it clears the doubt now.
Try to put minimum burden on your server since more the connections, more will be the load.
Regards
sinapra
|
|

September 9th, 2004, 05:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Quote:
quote:Originally posted by markhardiman
sorry i should provide more information although i think that from what you are all saying this should not be a problem. ... all databases will be on the same machine but they will be in different folders and different drives.
|
You can have them all open as long as the web server is good at handling it. But it is always a good practice to close the connection once you are done manipulating with its data, so as to free up resource and can open that up only when needed.
Hope that is what you are looking for.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|
 |