Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error When Creating a DBconnection inside of a class

Status
Not open for further replies.

bitrot

Programmer
Jun 3, 2004
13
US
Here is the offending code block... I get the following error. I don't know what is syntactically incorrect about it though.

Thanks In Advance.

----------------------------------

Error Number -2146827286
Error Code
Error Description Syntax error
ASP Description
Category Microsoft VBScript compilation
File Name /Cart/grabAndGo.asp
Line Number 41
Column 0
Error Source SET DBConn = SERVER.CREATEOBJECT("ADODB.Connection")

-----------------SNIP-----------
CLASS recordCollector
'Arrays
PRIVATE nameArray_
PRIVATE countArray_


'Record Sets Stuff
PRIVATE RS, dbConn, countRS
'Integers
PRIVATE RScount, LoopCounter
'Strings
PRIVATE query
PRIVATE dbLocation
PRIVATE criteria_


'Read the current nameArray value
Public Property Get nameArray()
nameArray = nameArray_
End Property

'Read the current countArray value
Public Property Get countArray()
countArray = countArray_
End Property

Public Property Let criteria(strData)
criteria_ = strData
End Property

'Connect to The Database
SET dbConn = SERVER.CREATEOBJECT("ADODB.Connection")
dbLocation = APPLICATION("globalDBConnectionSTR")
dbConn.Open dbLocation

--------------------------SNIP---------------------

 
do you only have problems on this page? or is this site/IIS wide?

[thumbsup2]DreX
aKa - Robert
 
It's only on this page, and only inside this class. If I comment out the offending line, it gives me the same "syntax error".
 
I mean, another syntax error, related to the recordset. I pulled the SET command and the Database connection out of the class and they all worked.
 
*shrugs* got me here, hopefully with the modifications you made you got it up and working though

[thumbsup2]DreX
aKa - Robert
 
yeah, I was stumped.. I just did it the wrong way and said forget it. It wasn't economically viable to waste more time on it. So much for code reuse in this situation. :sigh:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top