Marcus Young
|
| Posted: 05/20/2005, 6:41 AM |
|
Hi,
I'm trying to use CCDLookup to place a database field into a label. The code I am using is below.
In summary, this code is on a details page. The issue appears to relate to the WHERE part of the CCDLookup "ConGuid = '{GUID}'"
The variable GUID is obtained from the URL of the previous page and I have confirmed that this is working by my more simple CCDLookup for label2. I'm wondering if the CCDLookup command supports referencing a variable in the WHERE portion. Can you confirm. If it does, then any ideas why no result is returned by the query even though it should. When I replaced {GUID} with the actual GUID value everything works fine.
<%
'BindEvents Method @1-9CB12FEE
Sub BindEvents()
Set Label1.CCSEvents("BeforeShow") = GetRef("Label1_BeforeShow")
Set Label2.CCSEvents("BeforeShow") = GetRef("Label2_BeforeShow")
End Sub
'End BindEvents Method
Function Label1_BeforeShow() 'Label1_BeforeShow @29-D2D68993
'Custom Code @30-73254650
'DLookup @3-EE75397D
Dim GUID
GUID = CCGetParam("ContactID", 0)
Label1.Value = CCDLookUp("FirstName", "Contacts","ConGuid = '{GUID}'",DBJanna)
'End DLookup
'End Custom Code
End Function 'Close Label1_BeforeShow @29-54C34B28
Function Label2_BeforeShow() 'Label2_BeforeShow @31-AEB7AC48
'Custom Code @32-73254650
Dim GUID
GUID = CCGetParam("ContactID", 0)
Label2.Value = GUID
'End Custom Code
End Function 'Close Label2_BeforeShow @31-54C34B28
%>
|
|
|
 |
Oper
Posts: 1195
|
| Posted: 05/20/2005, 8:57 AM |
|
what are you trying to do with {GUID}???
Its a URL parameter or Field Value?
if GUID is a URL parameter try this
dim vGUID
vGUID =CCGetParam("GUID", " ")
Label1.Value = CCDLookUp("FirstName", "Contacts","ConGuid = '" & vGUID & "'",DBJanna)
http://www.GlobalDevelop.com
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
|