mljonzs
Posts: 124
|
| Posted: 08/23/2007, 2:57 PM |
|
I no longer have version 2 of CCS but one of our main applications was written using it and then was removed from code charge altogether so any changes I need to make I have to do by hand without the IDE.
I have a snippet of code below from the application that I tried to modify to use the SQL IN clause rather then the LIKE clause. I used CodeCharge 3 to look at the syntax which is why I have "opIn" for criteria(7) but this does not work - I get an ASP error saying : Quote :Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'opIn'
/testapps/OnlineOrder/QuoteList_QS.asp, line 686
Does the old CCS version not Support the IN clause? If not, does anyone know best way to modify to use the IN clause?? If it does, what have I done wrong?
Code Charge Code:
Public Sub BuildTableWhere()
Dim WhereParams
If Not WhereParameters Is Nothing Then _
Exit Sub
Set WhereParameters = new clsSQLParameters
With WhereParameters
Set .Connection = Connection
Set .ParameterSources = Parameters
Set .DataSource = Me
.AddParameter 1, "urlq", ccsInteger, Empty, Empty, Empty, False
.AddParameter 2, "urlnm", ccsText, Empty, Empty, Empty, False
.AddParameter 3, "urlna", ccsText, Empty, Empty, Empty, False
.AddParameter 4, "urlci", ccsText, Empty, Empty, Empty, False
.AddParameter 5, "urlst", ccsText, Empty, Empty, Empty, False
.AddParameter 6, "urlz", ccsText, Empty, Empty, Empty, False
.AddParameter 7, "cookooAMGroup", ccsText, Empty, Empty, Empty, False
.AddParameter 8, "cookooDealerID", ccsText, Empty, Empty, Empty, False
.AddParameter 9, "urllstStatii", ccsText, Empty, Empty, Empty, False '-----"E" removed 3/9/2006
.Criterion(1) = .Operation(opEqual, False, "QUOTE_NUMBER", .getParamByID(1))
.Criterion(2) = .Operation(opContains, False, "ID_CUST", .getParamByID(2))
.Criterion(3) = .Operation(opContains, False, "NAME", .getParamByID(3))
.Criterion(4) = .Operation(opContains, False, "CITY", .getParamByID(4))
.Criterion(5) = .Operation(opContains, False, "STATE", .getParamByID(5))
.Criterion(6) = .Operation(opContains, False, "ZIP", .getParamByID(6))
.Criterion(7) = .Operation(opIn, False, "AM_ID", .getParamByID(7))
.Criterion(8) = .Operation(opContains, False, "DEALER_ID", .getParamByID(8))
.Criterion(9) = .Operation(opEqual, False, "QUOTE_STATUS", .getParamByID(9))
.AssembledWhere = .opAND(False, .opAND(False, .opAND(False, .opAND(False, .opAND(False, .opAND(False, .opAND(False, .opAND(False, .Criterion(1), .Criterion(2)), .Criterion(3)), .Criterion(4)), .Criterion(5)), .Criterion(6)), .Criterion(7)), .Criterion(8)), .Criterion(9))
WhereParams = .AssembledWhere
If Len(Where) > 0 Then
If Len(WhereParams) > 0 Then _
Where = Where & " AND " & WhereParams
Else
If Len(WhereParams) > 0 Then _
Where = WhereParams
End If
End With
End Sub
_________________
What does not begin WITH God, will end in failure!
|