CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 retrieve the database connection

Print topic Send  topic

Author Message
codecharger

Posts: 8
Posted: 09/09/2005, 5:50 AM

i am very new to codecharge, i am looking for they way to get the database connection variable for use on a header pages _show events. as far as i can tell the connection is created in common.asp, but when i try to include that file in the header_show events page i get an error saying the page cannot be found...

thank you!
View profile  Send private message
peterr


Posts: 5971
Posted: 09/09/2005, 9:48 AM

Hi,
The Common.asp file is automatically included everywhere, so you don't need to do anything else. Many CCS examples include sample code that shows how to use database connection. The BookStore example also uses the database connection in the Header_events.asp page.
You can also refer to the documentation/help, for example the "Working With Databases" section.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
codecharger

Posts: 8
Posted: 09/09/2005, 9:55 AM

why then when i do a simple ccdlookup(), it tells me the database variable is undefined? i know its the correct variable because i have used it on a host of other pages, all of which have includes on the top of the page(inlude common files), but my events page does not have those includes. and when i try to include them i get another error: include file cannot be found

i really appreciate the help
View profile  Send private message
peterr


Posts: 5971
Posted: 09/09/2005, 10:06 AM

I recommend looking at the examples - they show how to initialize the connection.
The events pages are included by the main page, the same way as common files are included. Therefore there is nothing else to include.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
DonB
Posted: 09/09/2005, 11:32 AM

Although including Common.asp gives you the Connection class declaration,
you will not have a database connection VARIABLE defined or an active
connection created, unless you have a Record or Grid on the page. However,
you can always create one yourself like so:

dim ds

set ds = new clsDBInternet ' Assuming the connection you created is called
"Internet"
ds.Open
....

Now you can do your CCDLookUp(x,y,z,ds) using that connection

be sure to get rid of it when done:

set ds = Nothing


--
DonB

http://www.gotodon.com/ccbth


"codecharger" <codecharger@forum.codecharge> wrote in message
news:64321be99651fa@news.codecharge.com...
> why then when i do a simple ccdlookup(), it tells me the database variable
is
> undefined? i know its the correct variable because i have used it on a
host of
> other pages, all of which have includes on the top of the page(inlude
common
> files), but my events page does not have those includes. and when i try to
> include them i get another error: include file cannot be found
>
> i really appreciate the help
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

codecharger

Posts: 8
Posted: 09/09/2005, 1:50 PM

donb,
thanks - yes i figured that out, but thanks for the response, if i hadnt gotten it to work your post would have got me there without a doubt.

thanks again guys
View profile  Send private message

Add new topic Subscribe to topic   


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.