jonnyboyo
Posts: 15
|
| Posted: 02/15/2006, 6:57 AM |
|
Re-posted in ASP Forum
I'm trying to track logins and I keep getting the following error
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'clsDBWobenAdmin'
/wobenwebadmin/LOGIN_events.asp, line 31
The code I'm using is
Dim SQL
Dim Connection
Dim ErrorMessage
Set Connection = clsDBWobenAdmin
Connection.Open
SQL = "INSERT INTO login_log(UserID, login_date, login) VALUES (" & DBWobenAdmin.ToSQL(CCGetUserID(), ccsInteger) & "," & DBWobenAdmin.ToSQL(Now(), ccsDate) & "," & DBWobenAdmin.ToSQL(CCGetParam("Login",""), ccsText) &")"
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0
I have followed the code as setout by Peterr in his post http://forums.codecharge.com/posts.php?post_id=42883&s_keyword=track+logins
The strange thing is I have this working on another website login with the following code :
Dim SQL
SQL = "INSERT INTO login_log(UserID, login_date, login) VALUES (" & DBa4gzine.ToSQL(CCGetUserID(), ccsInteger) & "," & DBa4gzine.ToSQL(Now(), ccsDate) & "," & DBa4gzine.ToSQL(CCGetParam("Login",""), ccsText) &")"
DBa4gzine.Execute (SQL)
This is in CCS, the new one is in CCS3
Thanks
|
 |
 |
jonnyboyo
Posts: 15
|
| Posted: 02/15/2006, 7:00 AM |
|
Sorry also tried
Set Connection = New clsDBWobenAdmin
Connection.Open
as per Peterr's post
Same error
|
 |
 |
peterr
Posts: 5971
|
| Posted: 02/15/2006, 11:21 AM |
|
Is it possible that don't have a connection named "WobenAdmin" ?
(BTW, I removed your last post as ir was not related to this topic. Please submit unrelated questions separately.)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jonnyboyo
Posts: 15
|
| Posted: 02/15/2006, 12:50 PM |
|
Yes I'd looked at that and the connections were all fine.
I've now changed my connection name to "data" so that I can use the same code in all my projects.
I seem to have discovered why this wasn't working by comparing the code in the asp files. The login.asp page of the older version ( CCS ) had the following code
' Connections
Dim DBdata
and
'Initialize Objects @1-8C337256
Set DBdata = New clsDBdata
DBdata.Open
This wasn't written in the CCS3 login.asp page. I added the code in the relevant places and it now works.
I don't know if this is a bug or by design but it appears to have cured the error and I can now write the login information to a log table.
It was the same in several CCS3 projects and once added it seems to work in all of them.
My code is now :
Dim SQL
SQL = "INSERT INTO login_log(UserID, login_date, login, SiteID) VALUES (" & DBData.ToSQL(CCGetUserID(), ccsInteger) & "," & DBData.ToSQL(Now(), ccsDate) & "," & DBData.ToSQL(CCGetParam("Login",""), ccsText) & "," & DBData.ToSQL(CCGetParam("SiteID",""), ccsText) &")"
DBData.Execute (SQL)
and it works perfectly.
Thanks
|
 |
 |
|