CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 In Clause in CCS 2.0

Print topic Send  topic

Author Message
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!
View profile  Send private message
matheus

Posts: 386
Posted: 08/24/2007, 4:54 AM

CCS2 doesn't support IN clause.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
peterr


Posts: 5971
Posted: 08/24/2007, 10:25 AM

With CCS2 you could use the IN clause within the SQL statement, therefore you may be able to modify the SQL statement in the code.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mljonzs

Posts: 124
Posted: 08/24/2007, 11:04 AM

Thanks for the input.

I did end up getting it to work for me by adding some custom logic in the BeforeBuildSelect where I coded in my IN clause as follows:


Function vw_CustomerQuotesSummary_DataSource_BeforeBuildSelect()  
    'this version of CodeCharge does not support the SQL IN Clause so we need to code it here  
    if vw_CustomerQuotesSummary.DataSource.Where <> Empty then  
        vw_CustomerQuotesSummary.DataSource.Where = vw_CustomerQuotesSummary.DataSource.Where & " AND "  
    end if  
  
    vw_CustomerQuotesSummary.DataSource.Where = vw_CustomerQuotesSummary.DataSource.Where _  
        & "AM_ID IN " & Trim(Request.Cookies("ooAMGroup")) & " "  
End Function  'Close vw_CustomerQuotesSummary_DataSource_BeforeBuildSelect  

I should have known this before posting but sometimes at the end of the day - I'm fried. :)

_________________
What does not begin WITH God, will end in failure!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.