CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 2 databases for one project

Print topic Send  topic

Author Message
Wizy
Posted: 02/03/2003, 3:32 PM


With CC (not CCS) how does one set up for CC to use 2 databases? I've tried the example found in the articles section, but it only calls to use one database at one time.

I need 2 db's to be accessed all the time for every page in the project.

One db is used for Authentication/Admin so it contains user information.
The other db, of course, is used for the project/application.

Anyone know how to set it up to use 2 db's at once in CC?
Wizy
Posted: 02/05/2003, 11:10 AM

Anyone?
NoName
Posted: 02/05/2003, 7:33 PM

WizyWig, have you noticed how you are not getting answers to your questions? Have you read the CC manuals? Have you browsed thru the Tips&Tricks section? Have you picked up basic SQL yet? -- Your questions are all anwered there.

Sorry, yoy cannot have your cake and eat it too!
Wizy
Posted: 02/05/2003, 7:48 PM

NoName,

Dont be smart with me. I wouldn't be here if I didn't. Did you not read my 2nd sentence in my intial post?

I've searched this forum for information about 2 DB's for CC (not CCS) = nada on that.

I got an answer that lead to a tips articles that doesn't explain how to do it for 2 connectiosn all the time on each page, not one connection.

It doesn't explain why I have errors when I try to include both connections at the same time.

Care to explain it all knowing one?

According to this website, you dont need to know programming or have a understanding of SQL in order to use these programs, so keep your smart-ass comments to yourself.

NoName
Posted: 02/06/2003, 8:12 AM

I got an answer that lead to a tips articles that doesn't explain how to do it for 2 connectiosn all the time on each page, not one connection.

I did not get that to work either and do not know of anyone who did. But you can do it in CCStudio. So there are 2 options for you:
1) upgrade to CCS
2) fill in YS formal support request.


Good Luck!
NoName
Posted: 02/06/2003, 8:15 AM

... are you sure this Tips article is not what you are looking for?



2 database connections in 1 project

This tip is useful if your web application needs to access 2
databases at a time and every page uses only 1 connection.
To create 1st connection set it up in Site/Properties/Database,
generate site and save Common.asp(php,pm etc.) under a different
name. Next change Site/Properties/Database settings to point to
another database. Now we have 2 common files , one is automatically
included into CC scripts (1st connection) , and in every script that needs
to connect to another database, the following should be done :

Select Page/"Custom includes" event , click "Obtain generated code",
and modify inclusion directives to include another coomon file.

E.g.


%>

<!-- #INCLUDE FILE="Common2.asp" -->
<!-- #INCLUDE FILE="header.asp" -->

<%



Best regards,
Alexey Alexapolsky


Wizy
Posted: 02/06/2003, 11:17 AM


yes, thats the only one ,and that one doesn't work.

IF you put include both common.php and common2.php files into a page (for all pages), you get an error saying "cannnot redeclare" some function. Care to explain why?

Cannot upgrade to CCS since its out of my price range, and at this point in time, is not worth the extra $150+ to get it.
Wizy
Posted: 02/06/2003, 11:41 AM



Using the example in the Tips and Tricks section (which doesn't address how it can be used for any purpose )

I get the follwing error, when I try to include both common files into a page.
Im using one db for the application, but Im using another DB to handle the admin information (ie, name and pw). So naturally, all the admin duties(ie editing records, adding items) need to have both commons included for each page.

In the Book Store example, for example; when i goto the "adminMenu" page, i get this error:

Fatal error: Cannot redeclare class db_sql in c:\apache\htdocs\mdb2\db_mysql.inc on line 12


Because common.php uses that class already, so when including common2.php, its using that same class again.

What do I edit in either common files, or make it so that its all in one common file?
NoName
Posted: 02/06/2003, 12:06 PM

That tip was written by Alexey Alexapolsky who is the YS support engineer. I suggest that you fill out the CC Support request form and ask him for help.
befuddled
Posted: 05/04/2003, 7:32 PM

thought this multiple connections was supposed ot be easy...does the update make it easier than the above

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.