Author |
Topic |
Alfred
Senior Member
USA
1527 Posts |
Posted - 23 October 2003 : 00:12:42
|
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
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 23 October 2003 : 00:40:09
|
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 |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 23 October 2003 : 18:50:11
|
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
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 23 October 2003 : 19:32:32
|
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 ~ |
|
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 23 October 2003 : 21:26:40
|
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
|
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
Posted - 24 October 2003 : 00:23:18
|
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 |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Alfred
Senior Member
USA
1527 Posts |
|
Topic |
|