smalloy
Posts: 107
|
| Posted: 10/21/2004, 6:45 AM |
|
I need to redirect to a different page depending on the group and would like to log and display the customary Welcome {UserLogin}. I am using the CCDLookup but get an error on connection name - "Variable DBinternet not found"
I tried Session("UserLogin") but that returns nothing even when I am logged in - are there standard i.e. non code Charge session variables? - I'm new to programming.
Here's my code but it returns that "Variable DBinternet not found" error.
Any help is GREATLY appreciated!!
<%
'BindEvents Method @1-4768C185
Sub BindEvents()
Set lblUser_Name.CCSEvents("BeforeShow") = GetRef("lblUser_Name_BeforeShow")
End Sub
'End BindEvents Method
Function lblUser_Name_BeforeShow() 'lblUser_Name_BeforeShow @5-61705AEA
'Custom Code @6-73254650
Dim WelcomeName
If Session("PortalUserId") >= 1 Then
WelcomeName = CCDLookup("first_name", "users", "user_id =" & Session("PortalUserId"), DBinternet)
lblUser_Name.Value = WelcomeName
ELSE
lblUser_Name.Value = WelcomeName
End If
'End Custom Code
End Function 'Close lblUser_Name_BeforeShow @5-54C34B28
%>
_________________
Anything can be done, just give me time and money. |
 |
 |
Joe
|
| Posted: 10/21/2004, 10:54 AM |
|
what is the name of you connection?
|
|
|
 |
smalloy
Posts: 107
|
| Posted: 10/21/2004, 11:13 AM |
|
My connection name is internet.
Here is the error msg:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'DBinternet'
/AMSPORTAL/Emp_Initial_events.asp, line 14
THANK YOU for helping. This project was due on Monday!
_________________
Anything can be done, just give me time and money. |
 |
 |
peterr
Posts: 5971
|
| Posted: 10/21/2004, 2:02 PM |
|
Possibly you just need to create the connection object.
See an example at http://docs.codecharge.com/studio/html/ProgrammingTechn...eCustomSQL.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Joe
|
| Posted: 10/25/2004, 7:50 AM |
|
Just wondering if you figured it out yet??????
|
|
|
 |
smalloy
Posts: 107
|
| Posted: 10/29/2004, 6:40 AM |
|
Just in case anyone wants to know peterr was correct, the page that I was working with had no instance of a connection. Here is the final result:
'Custom Code @6-73254650
Dim WelcomeName
Dim DBinternet
Set DBinternet = New clsDBinternet
DBinternet.Open
If Session("PortalUserId") >= 1 Then
WelcomeName = CCDLookup("first_name", "users", "user_id =" & Session("PortalUserId"), DBinternet)
lblUser_Name.Value = WelcomeName
ELSE
lblUser_Name.Value = WelcomeName
End If
If DBinternet.State = adStateOpen Then _
DBinternet.Close
Set DBinternet = Nothing
'End Custom Code
_________________
Anything can be done, just give me time and money. |
 |
 |
|