Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How do you link to subs?
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

Alfred
Senior Member

USA
1527 Posts

Posted - 23 October 2003 :  00:12:42  Show Profile  Visit Alfred's Homepage
It was included after the connection was closed.
Is it ok to reopen it just before the include file, like so:
quote:
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
%>
<!--#INCLUDE FILE="news.asp" --><br>




Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 23 October 2003 :  00:16:09  Show Profile
the connection shouldn't be closed in inc_header ... it is closed in inc_footer.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 23 October 2003 :  00:40:09  Show Profile  Visit Alfred's Homepage
It was actually closed in sub WriteNewMember() within the header file.
I took it out of there now.
I also found it further up in the header file closed, and commented it out.
The defalt page displays ok, but the options still give an error:
quote:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/BG/forums/news.asp, line 14

I believe this is the error one gets when the config file is not included in a page.
But I had to take it out because of the previous error, right?
When I include the config file in news.asp, or in inc_header.asp I get this error
quote:
Error Type:
Microsoft VBScript compilation (0x800A0411)
Name redefined
/BG/forums/inc_adovbs.asp, line 14, column 6
Const adOpenForwardOnly = 0


Alfred
The Battle Group
CREDO

Edited by - Alfred on 23 October 2003 12:15:43
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 23 October 2003 :  13:33:16  Show Profile
why don't you post text versions of your current news.asp and inc_header.asp files.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 23 October 2003 :  15:04:55  Show Profile  Visit Alfred's Homepage
Yes - here they are:
http://www.ggholiday.com/bg/forums/inc_header.txt
http://www.ggholiday.com/bg/forums/news.txt

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 23 October 2003 :  16:04:30  Show Profile
you are still reopening the connection to the database in news

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 23 October 2003 :  18:50:11  Show Profile  Visit Alfred's Homepage
Yes, I put it back there after getting:
quote:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/BG/forums/news.asp, line 14

So, if it should not be there I take it out again.
That means I don't know the real cause of the above error...

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 23 October 2003 :  19:32:32  Show Profile
not sure what is going on with your code and i'm a little to busy to look at it in detail right now. i did notice however that you have a lot of places where you are opening recordsets, but not closing them. that wouldn't cause the specific error, but it would be nice to have clean code ... especially closing recordsets as it can cause problems in the long run.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 23 October 2003 :  21:26:40  Show Profile  Visit Alfred's Homepage
That is quite allright, Nikkol, since this is not an urgent project, but just something I would like to learn how to incorporate in my pages.
Please put it on a back burner.
For now, could you just tell me how to do the current year, like you found a way to do the month? I wrote:
quote:
strPreviousDay = DateToStr(DateAdd("d",-30,Now()))

strSql = "SELECT COUNT(MEMBER_ID) AS NAME_COUNT FROM FORUM_MEMBERS WHERE M_DATE > '" & strPreviousDay & "'"

If I can define strPreviousDay as Jan 1 2003 I would leave the line for now just showing year to date data.

Alfred
The Battle Group
CREDO
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 23 October 2003 :  22:00:47  Show Profile
strPreviousDay = "1/1/" & Year(Now())

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 24 October 2003 :  00:23:18  Show Profile  Visit Alfred's Homepage
Oh boy, what fun programming must be for you!

Thanks, I can make good use of that.
quote:
strPreviousDay = "1/1/" & Year(Now())
strSql = "SELECT COUNT(start_date) AS GAME_COUNT FROM GAMES WHERE Start_Date > #'" & strPreviousDay & "'# and type = 'Ladder Duel'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn

response.write rs("GAME_COUNT")


PS.: Oops - what is the syntax error?
quote:
Error Type:
Microsoft JET Database Engine (0x80040E07)
Syntax error in date in query expression 'Start_Date > #'1/1/2003'# and type = 'Ladder Duel''.
/BG/forums/news.asp, line 121


Alfred
The Battle Group
CREDO

Edited by - Alfred on 24 October 2003 16:13:44
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 24 October 2003 :  17:37:01  Show Profile
you have both ' and # around the date.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 24 October 2003 :  20:18:08  Show Profile  Visit Alfred's Homepage
That was it!
And I thought I had tried all variations!
Looks great, thanks to you: http://www.ggholiday.com/bg/forums/DEFAULT.ASP

Alfred
The Battle Group
CREDO
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07