|
 |
asp_database_setup thread: Brain Dead
Message #1 by mdehnel@a... on Sat, 28 Jul 2001 03:55:24
|
|
Microsoft VBScript runtime error '800a01a8'
Object required: 'con'
/pages/tools.asp, line 429
Notice the case in the error? its lower...?
But when I make the call from the function to open a connection and all
the
other reference to the connection are "Con". - Uppercase
Except for the Sub that opens the connection "by ref" where it's lower too.
My brain is rolling on to the floor, please help or it may be to late for
me
ps Ken I'm trying to be neater
'--------------------------------------------------------------------------
' Dummy page I created to troubleshoot the two function calls below
' Problem is I can't get connected for some reason
'--------------------------------------------------------------------------
<!--#include file="tools.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
try here!
<%
' change main2.asp back to main.asp in the master than distroy this
file
If fnTimeExpired() Then
Application.lock
' set this back to 1 once it appears to be working correctly
Application("tofDBLocked") = 0
Application.unlock
fnProcessAllPicks()
' fnToggleGameLock(1)
Application.lock
Application("tofDBLocked") = 0
Application.unlock
End If
%>
</body>
</html>
'--------------------------------------------------------------------------
----
Function fnProcessAllPicks()
'--------------------------------------------------------------------------
----
Dim Con
Dim objRSPlyrs
Dim objRSPicks
Dim SQLPlyrs
Dim SQLPicks
Dim intPlyr
Dim tofLocked
Dim tofVinBoth
Dim tofVinTeam
Dim intPickID
Dim flagIgnor
Dim flagLockOnly
OpenAddress(Con)
Set objRSPlyrs = Server.CreateObject("ADODB.Recordset")
Set objRSPicks = Server.CreateObject("ADODB.Recordset")
SQLPlyrs = "SELECT " & _
"Players.PlayerID, " & _
"Players.First, " & _
"Players.Last, " & _
"Players.fldUsername, " & _
"Players.emailh " & _
"FROM " & _
"Players;"
SQLPicks = "SELECT " & _
"Picks.PickID, " & _
"Picks.PlayerID, " & _
"Picks.Week, " & _
"Picks.TeamID, " & _
"Picks.plyrGuess, " & _
"Picks.LockPick " & _
"FROM " & _
"Picks " & _
"WHERE " & _
"((Picks.Week)= " & _
CInt(Application("intPoolWeek")) & " );"
Set objRSPlyrs = Con.Execute( SQLPlyrs ) <--- line 429
Set objRSPicks = Con.Execute( SQLPicks )
' blah blah blah
'--------------------------------------------------------------------------
------
' The sub OpenAddress
'--------------------------------------------------------------------------
------
'--- This function opens database connection
Sub OpenAddress(ByRef con)
Set con = Server.CreateObject("ADODB.Connection")
' con.ConnectionString = "Provider=MSDASQL.1;Persist Security
Info=False;Data Source=2001db"
' con.Open
con.Open "DSN=2001db"
End Sub
Message #2 by "Vincent Vandermeeren" <vincentvdm@p...> on Sat, 28 Jul 2001 11:53:36 +0200
|
|
Hi mdehnel,
for me it sound more like he doesn't know what to do with the "con"-variable
there you don't specify what con is.
That what I think but I think also that Ken can tell you more ...
He's for me one the big examples of a "asp goeroe (*)" on this mailinglists.
(*) = someone who knows almost anything about ASP
Greetings,
Vinnie
Message #3 by "Ken Schaefer" <ken@a...> on Sun, 29 Jul 2001 12:28:49 +1000
|
|
I think it should work. You might want to put some troubleshooting
Response.Write()s into your code. Eg inside your OpenAddress() sub, you
could put:
con.Open "DSN=2001db"
If isObject(con) then
Response.Write("is an object<br>")
If con.State = 1 then
Response.Write("con is open")
Else
Response.Write("con is not open")
End If
Else
Response.Write("Con is not an object")
End If
to make sure that Con is actually an object, and being opened...
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <mdehnel@a...>
To: "ASP Database Setup" <asp_database_setup@p...>
Sent: Saturday, July 28, 2001 3:55 AM
Subject: [asp_database_setup] Brain Dead
: Microsoft VBScript runtime error '800a01a8'
:
: Object required: 'con'
:
: /pages/tools.asp, line 429
:
: Notice the case in the error? its lower...?
: But when I make the call from the function to open a connection and all
: the
: other reference to the connection are "Con". - Uppercase
:
: Except for the Sub that opens the connection "by ref" where it's lower
too.
:
: My brain is rolling on to the floor, please help or it may be to late for
: me
:
: ps Ken I'm trying to be neater
:
:
:
'--------------------------------------------------------------------------
: ' Dummy page I created to troubleshoot the two function calls below
: ' Problem is I can't get connected for some reason
:
'--------------------------------------------------------------------------
:
:
: <!--#include file="tools.asp"-->
: <html>
:
: <head>
: <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
: <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
: <meta name="ProgId" content="FrontPage.Editor.Document">
: <title>New Page 1</title>
: </head>
:
: <body>
:
: try here!
:
: <%
: ' change main2.asp back to main.asp in the master than distroy this
: file
:
: If fnTimeExpired() Then
: Application.lock
: ' set this back to 1 once it appears to be working correctly
: Application("tofDBLocked") = 0
: Application.unlock
: fnProcessAllPicks()
: ' fnToggleGameLock(1)
: Application.lock
: Application("tofDBLocked") = 0
: Application.unlock
: End If
:
: %>
:
: </body>
:
: </html>
:
:
:
'--------------------------------------------------------------------------
: ----
: Function fnProcessAllPicks()
:
'--------------------------------------------------------------------------
: ----
:
: Dim Con
: Dim objRSPlyrs
: Dim objRSPicks
: Dim SQLPlyrs
: Dim SQLPicks
: Dim intPlyr
: Dim tofLocked
: Dim tofVinBoth
: Dim tofVinTeam
: Dim intPickID
: Dim flagIgnor
: Dim flagLockOnly
:
: OpenAddress(Con)
:
: Set objRSPlyrs = Server.CreateObject("ADODB.Recordset")
: Set objRSPicks = Server.CreateObject("ADODB.Recordset")
:
: SQLPlyrs = "SELECT " & _
: "Players.PlayerID, " & _
: "Players.First, " & _
: "Players.Last, " & _
: "Players.fldUsername, " & _
: "Players.emailh " & _
: "FROM " & _
: "Players;"
:
: SQLPicks = "SELECT " & _
: "Picks.PickID, " & _
: "Picks.PlayerID, " & _
: "Picks.Week, " & _
: "Picks.TeamID, " & _
: "Picks.plyrGuess, " & _
: "Picks.LockPick " & _
: "FROM " & _
: "Picks " & _
: "WHERE " & _
: "((Picks.Week)= " & _
: CInt(Application("intPoolWeek")) & " );"
:
: Set objRSPlyrs = Con.Execute( SQLPlyrs ) <--- line 429
: Set objRSPicks = Con.Execute( SQLPicks )
:
: ' blah blah blah
:
:
'--------------------------------------------------------------------------
: ------
: ' The sub OpenAddress
:
'--------------------------------------------------------------------------
: ------
:
:
: '--- This function opens database connection
: Sub OpenAddress(ByRef con)
: Set con = Server.CreateObject("ADODB.Connection")
: ' con.ConnectionString = "Provider=MSDASQL.1;Persist Security
: Info=False;Data Source=2001db"
: ' con.Open
: con.Open "DSN=2001db"
:
: End Sub
: ---
: Search the best ASP Web sites using CodeHound! http://www.codehound.com
: Now it's easy to find ASP source code on the Internet. CodeHound's free
: search engine will categorize your results and even search for ASP code
: compressed in Zip files on the Internet. Stop searching dozens of
: different sites to find what you want...try CodeHound right now!
ken@a...
$subst('Email.Unsub')
Message #4 by "Ken Schaefer" <ken@a...> on Sun, 29 Jul 2001 12:29:21 +1000
|
|
Oh, and put <%Option Explicit%> at the top of your code.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <mdehnel@a...>
To: "ASP Database Setup" <asp_database_setup@p...>
Sent: Saturday, July 28, 2001 3:55 AM
Subject: [asp_database_setup] Brain Dead
: Microsoft VBScript runtime error '800a01a8'
:
: Object required: 'con'
:
: /pages/tools.asp, line 429
:
:
Message #5 by mdehnel@a... on Tue, 31 Jul 2001 19:07:58
|
|
This and the troubleshooting code help THANKS
It turnned out to be that I was calling the OpenAddress subroutine without
the "CALL" keyword. So my next dumb question is why? I thought the
the "CALL" keyword was optional. Are there specific rules for instances
that require "CALL" to be there?
Thanks again
> Oh, and put <%Option Explicit%> at the top of your code.
>
> Cheers
> Ken
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ----- Original Message -----
> From: <mdehnel@a...>
> To: "ASP Database Setup" <asp_database_setup@p...>
> Sent: Saturday, July 28, 2001 3:55 AM
> Subject: [asp_database_setup] Brain Dead
>
>
> : Microsoft VBScript runtime error '800a01a8'
> :
> : Object required: 'con'
> :
> : /pages/tools.asp, line 429
> :
> :
>
|
|
 |