<%@ CodePage=1252 %> <% 'Include Common Files @1-1264DE53 %> <% 'End Include Common Files 'Initialize Page @1-125A4389 ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage Dim Attributes ' Events Dim CCSEvents Dim CCSEventResult ' Connections Dim DBConnection1 ' Page controls Dim anmSearch Dim anm Dim ChildControls Response.ContentType = CCSContentType Redirect = "" TemplateFileName = "anm_list.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "anm_list.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-65EC2337 Set DBConnection1 = New clsDBConnection1 DBConnection1.Open Set Attributes = New clsAttributes ' Controls Set anmSearch = new clsRecordanmSearch Set anm = New clsGridanm anm.Initialize DBConnection1 CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-3BBF1726 anmSearch.Operation 'End Execute Components 'Go to destination page @1-6D35F4FD If NOT ( Redirect = "" ) Then UnloadPage Response.Redirect Redirect End If 'End Go to destination page 'Initialize HTML Template @1-7509502B CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate HTMLTemplate.Encoding = "windows-1252" Set HTMLTemplate.Cache = TemplatesRepository HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot Set Tpl = HTMLTemplate.Block("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing) 'End Initialize HTML Template 'Show Page @1-198B6F48 Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(anmSearch, anm)) ChildControls.Show Dim MainHTML HTMLTemplate.Parse "main", False MainHTML = HTMLTemplate.GetHTML("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing) If CCSEventResult Then Response.Write MainHTML 'End Show Page 'Unload Page @1-CB210C62 UnloadPage Set Tpl = Nothing Set HTMLTemplate = Nothing 'End Unload Page 'UnloadPage Sub @1-149AD235 Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBConnection1.State = adStateOpen Then _ DBConnection1.Close Set DBConnection1 = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Set anmSearch = Nothing Set anm = Nothing End Sub 'End UnloadPage Sub Class clsRecordanmSearch 'anmSearch Class @2-23F83C5E 'anmSearch Variables @2-3F7E617D ' Public variables Public ComponentName Public HTMLFormAction Public PressedButton Public Errors Public FormSubmitted Public EditMode Public Visible Public Recordset Public TemplateBlock Public Attributes Public CCSEvents Private CCSEventResult Public InsertAllowed Public UpdateAllowed Public DeleteAllowed Public ReadAllowed Public DataSource Public Command Public ValidatingControls Public Controls ' Class variables Dim s_den_com Dim s_dci Dim s_forma_farm Dim s_cod_atc Dim s_cim Dim s_firm_tar_d Dim anmPageSize Dim Button_DoSearch 'End anmSearch Variables 'anmSearch Class_Initialize Event @2-C00493E6 Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes InsertAllowed = False UpdateAllowed = False DeleteAllowed = False ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "anmSearch") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "anmSearch" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set s_den_com = CCCreateControl(ccsTextBox, "s_den_com", Empty, ccsText, Empty, CCGetRequestParam("s_den_com", Method)) Set s_dci = CCCreateControl(ccsTextBox, "s_dci", Empty, ccsText, Empty, CCGetRequestParam("s_dci", Method)) Set s_forma_farm = CCCreateControl(ccsTextBox, "s_forma_farm", Empty, ccsText, Empty, CCGetRequestParam("s_forma_farm", Method)) Set s_cod_atc = CCCreateControl(ccsTextBox, "s_cod_atc", Empty, ccsText, Empty, CCGetRequestParam("s_cod_atc", Method)) Set s_cim = CCCreateControl(ccsTextBox, "s_cim", Empty, ccsText, Empty, CCGetRequestParam("s_cim", Method)) Set s_firm_tar_d = CCCreateControl(ccsTextBox, "s_firm_tar_d", Empty, ccsText, Empty, CCGetRequestParam("s_firm_tar_d", Method)) Set anmPageSize = CCCreateList(ccsListBox, "anmPageSize", Empty, ccsText, CCGetRequestParam("anmPageSize", Method), Empty) Set anmPageSize.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("", "5", "10", "25", "100"), _ Array("Select Value", "5", "10", "25", "100"))) Set Button_DoSearch = CCCreateButton("Button_DoSearch", Method) Set ValidatingControls = new clsControls ValidatingControls.addControls Array(s_den_com, s_dci, s_forma_farm, s_cod_atc, s_cim, s_firm_tar_d, anmPageSize) End Sub 'End anmSearch Class_Initialize Event 'anmSearch Class_Terminate Event @2-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End anmSearch Class_Terminate Event 'anmSearch Validate Method @2-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End anmSearch Validate Method 'anmSearch Operation Method @2-7048E07D Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = "Button_DoSearch" If Button_DoSearch.Pressed Then PressedButton = "Button_DoSearch" End If End If Redirect = "anm_list.asp" If Validate() Then If PressedButton = "Button_DoSearch" Then If NOT Button_DoSearch.OnClick() Then Redirect = "" Else Redirect = "anm_list.asp?" & CCGetQueryString("Form", Array(PressedButton, "ccsForm", "Button_DoSearch.x", "Button_DoSearch.y", "Button_DoSearch")) End If End If Else Redirect = "" End If End Sub 'End anmSearch Operation Method 'anmSearch Show Method @2-660557CC Sub Show(Tpl) If NOT Visible Then Exit Sub EditMode = False HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "anmSearch" & IIf(EditMode, ":Edit", "")) Set TemplateBlock = Tpl.Block("Record " & ComponentName) If TemplateBlock is Nothing Then Exit Sub TemplateBlock.Variable("HTMLFormName") = ComponentName TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded" Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(s_den_com, s_dci, s_forma_farm, s_cod_atc, s_cim, s_firm_tar_d, anmPageSize, Button_DoSearch)) If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors s_den_com.Errors Errors.AddErrors s_dci.Errors Errors.AddErrors s_forma_farm.Errors Errors.AddErrors s_cod_atc.Errors Errors.AddErrors s_cim.Errors Errors.AddErrors s_firm_tar_d.Errors Errors.AddErrors anmPageSize.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = IIF(CCSUseAmps, Replace(HTMLFormAction, "&", CCSAmps), HTMLFormAction) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "anmSearch" & ":" Controls.Show End If End Sub 'End anmSearch Show Method End Class 'End anmSearch Class @2-A61BA892 Class clsGridanm 'anm Class @11-891C5BF4 'anm Variables @11-7B67D404 ' Private variables Private VarPageSize ' Public variables Public ComponentName, CCSEvents Public Visible, Errors Public DataSource Public PageNumber Public Command Public TemplateBlock Public IsDSEmpty Public ForceIteration Public Attributes Private ShownRecords Public ActiveSorter, SortingDirection Public Recordset Private CCSEventResult ' Grid Controls Public StaticControls, RowControls Dim Sorter_den_com Dim Sorter_dci Dim Sorter_forma_farm Dim Sorter_cod_atc Dim Sorter_cim Dim Sorter_firm_tar_d Dim Sorter_bulina Dim Sorter_diez Dim Sorter_stea Dim Sorter_triunghi Dim Sorter_cerc Dim Detail Dim den_com Dim dci Dim forma_farm Dim cod_atc Dim cim Dim firm_tar_d Dim bulina Dim diez Dim stea Dim triunghi Dim cerc Dim Navigator 'End anm Variables 'anm Class_Initialize Event @11-F2A88EF0 Private Sub Class_Initialize() ComponentName = "anm" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set Errors = New clsErrors Set DataSource = New clsanmDataSource Set Command = New clsCommand PageSize = CCGetParam(ComponentName & "PageSize", Empty) If IsNumeric(PageSize) And Len(PageSize) > 0 Then If PageSize <= 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageSizeError", Empty)) If PageSize > 100 Then PageSize = 100 End If If NOT IsNumeric(PageSize) OR IsEmpty(PageSize) Then _ PageSize = 20 _ Else _ PageSize = CInt(PageSize) PageNumber = CCGetParam(ComponentName & "Page", 1) If Not IsNumeric(PageNumber) And Len(PageNumber) > 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty)) PageNumber = 1 ElseIf Len(PageNumber) > 0 Then If PageNumber > 0 Then PageNumber = CInt(PageNumber) Else Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty)) PageNumber = 1 End If Else PageNumber = 1 End If ActiveSorter = CCGetParam("anmOrder", Empty) SortingDirection = CCGetParam("anmDir", Empty) If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _ SortingDirection = Empty Set Sorter_den_com = CCCreateSorter("Sorter_den_com", Me, FileName) Set Sorter_dci = CCCreateSorter("Sorter_dci", Me, FileName) Set Sorter_forma_farm = CCCreateSorter("Sorter_forma_farm", Me, FileName) Set Sorter_cod_atc = CCCreateSorter("Sorter_cod_atc", Me, FileName) Set Sorter_cim = CCCreateSorter("Sorter_cim", Me, FileName) Set Sorter_firm_tar_d = CCCreateSorter("Sorter_firm_tar_d", Me, FileName) Set Sorter_bulina = CCCreateSorter("Sorter_bulina", Me, FileName) Set Sorter_diez = CCCreateSorter("Sorter_diez", Me, FileName) Set Sorter_stea = CCCreateSorter("Sorter_stea", Me, FileName) Set Sorter_triunghi = CCCreateSorter("Sorter_triunghi", Me, FileName) Set Sorter_cerc = CCCreateSorter("Sorter_cerc", Me, FileName) Set Detail = CCCreateControl(ccsLink, "Detail", Empty, ccsText, Empty, CCGetRequestParam("Detail", ccsGet)) Set den_com = CCCreateControl(ccsLabel, "den_com", Empty, ccsText, Empty, CCGetRequestParam("den_com", ccsGet)) Set dci = CCCreateControl(ccsLabel, "dci", Empty, ccsText, Empty, CCGetRequestParam("dci", ccsGet)) Set forma_farm = CCCreateControl(ccsLabel, "forma_farm", Empty, ccsText, Empty, CCGetRequestParam("forma_farm", ccsGet)) Set cod_atc = CCCreateControl(ccsLabel, "cod_atc", Empty, ccsText, Empty, CCGetRequestParam("cod_atc", ccsGet)) Set cim = CCCreateControl(ccsLabel, "cim", Empty, ccsText, Empty, CCGetRequestParam("cim", ccsGet)) Set firm_tar_d = CCCreateControl(ccsLabel, "firm_tar_d", Empty, ccsText, Empty, CCGetRequestParam("firm_tar_d", ccsGet)) Set bulina = CCCreateControl(ccsLabel, "bulina", Empty, ccsText, Empty, CCGetRequestParam("bulina", ccsGet)) Set diez = CCCreateControl(ccsLabel, "diez", Empty, ccsText, Empty, CCGetRequestParam("diez", ccsGet)) Set stea = CCCreateControl(ccsLabel, "stea", Empty, ccsText, Empty, CCGetRequestParam("stea", ccsGet)) Set triunghi = CCCreateControl(ccsLabel, "triunghi", Empty, ccsText, Empty, CCGetRequestParam("triunghi", ccsGet)) Set cerc = CCCreateControl(ccsLabel, "cerc", Empty, ccsText, Empty, CCGetRequestParam("cerc", ccsGet)) Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 20, tpSimple) IsDSEmpty = True End Sub 'End anm Class_Initialize Event 'anm Initialize Method @11-2AEA3975 Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection DataSource.PageSize = PageSize DataSource.SetOrder ActiveSorter, SortingDirection DataSource.AbsolutePage = PageNumber End Sub 'End anm Initialize Method 'anm Class_Terminate Event @11-B97CC660 Private Sub Class_Terminate() Set CCSEvents = Nothing Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set Attributes = Nothing End Sub 'End anm Class_Terminate Event 'anm Show Method @11-9B500012 Sub Show(Tpl) Dim HasNext If NOT Visible Then Exit Sub Dim RowBlock With DataSource .Parameters("urls_den_com") = CCGetRequestParam("s_den_com", ccsGET) .Parameters("urls_dci") = CCGetRequestParam("s_dci", ccsGET) .Parameters("urls_forma_farm") = CCGetRequestParam("s_forma_farm", ccsGET) .Parameters("urls_cod_atc") = CCGetRequestParam("s_cod_atc", ccsGET) .Parameters("urls_cim") = CCGetRequestParam("s_cim", ccsGET) .Parameters("urls_firm_tar_d") = CCGetRequestParam("s_firm_tar_d", ccsGET) End With CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) If DataSource.Errors.Count = 0 Then IsDSEmpty = Recordset.EOF Set TemplateBlock = Tpl.Block("Grid " & ComponentName) If TemplateBlock is Nothing Then Exit Sub Set RowBlock = TemplateBlock.Block("Row") Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(Sorter_den_com, Sorter_dci, Sorter_forma_farm, Sorter_cod_atc, Sorter_cim, Sorter_firm_tar_d, Sorter_bulina, Sorter_diez, Sorter_stea, Sorter_triunghi, Sorter_cerc, Navigator)) Navigator.SetDataSource Recordset Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _ Array(Detail, den_com, dci, forma_farm, cod_atc, cim, firm_tar_d, bulina, diez, stea, triunghi, cerc)) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If NOT Visible Then Exit Sub RowControls.PreserveControlsVisible Errors.AddErrors DataSource.Errors If Errors.Count > 0 Then TemplateBlock.HTML = CCFormatError("Grid " & ComponentName, Errors) Else ' Show NoRecords block if no records are found If Recordset.EOF Then Attributes.Show TemplateBlock, "anm:" TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite End If HasNext = HasNextRow() ForceIteration = False Do While ForceIteration Or HasNext Attributes("rowNumber") = ShownRecords + 1 If HasNext Then Detail.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) Detail.Parameters = CCAddParam(Detail.Parameters, "ID", Recordset.Fields("Detail_param1")) Detail.Page = "anm_maint.asp" den_com.Value = Recordset.Fields("den_com") dci.Value = Recordset.Fields("dci") forma_farm.Value = Recordset.Fields("forma_farm") cod_atc.Value = Recordset.Fields("cod_atc") cim.Value = Recordset.Fields("cim") firm_tar_d.Value = Recordset.Fields("firm_tar_d") bulina.Value = Recordset.Fields("bulina") diez.Value = Recordset.Fields("diez") stea.Value = Recordset.Fields("stea") triunghi.Value = Recordset.Fields("triunghi") cerc.Value = Recordset.Fields("cerc") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("Row"), "anm:" RowControls.Show If HasNext Then Recordset.MoveNext ShownRecords = ShownRecords + 1 HasNext = HasNextRow() Loop Attributes.Show TemplateBlock, "anm:" StaticControls.Show End If End Sub 'End anm Show Method 'anm PageSize Property Let @11-54E46DD6 Public Property Let PageSize(NewValue) VarPageSize = NewValue DataSource.PageSize = NewValue End Property 'End anm PageSize Property Let 'anm PageSize Property Get @11-9AA1D1E9 Public Property Get PageSize() PageSize = VarPageSize End Property 'End anm PageSize Property Get 'anm RowNumber Property Get @11-F32EE2C6 Public Property Get RowNumber() RowNumber = ShownRecords + 1 End Property 'End anm RowNumber Property Get 'anm HasNextRow Function @11-9BECE27A Public Function HasNextRow() HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize End Function 'End anm HasNextRow Function End Class 'End anm Class @11-A61BA892 Class clsanmDataSource 'anmDataSource Class @11-A21B1428 'DataSource Variables @11-3D2EAD6D Public Errors, Connection, Parameters, CCSEvents Public Recordset Public SQL, CountSQL, Order, Where, Orders, StaticOrder Public PageSize Public PageCount Public AbsolutePage Public Fields Dim WhereParameters Public AllParamsSet Public CmdExecution Public InsertOmitIfEmpty Public UpdateOmitIfEmpty Private CurrentOperation Private CCSEventResult ' Datasource fields Public Detail_param1 Public den_com Public dci Public forma_farm Public cod_atc Public cim Public firm_tar_d Public bulina Public diez Public stea Public triunghi Public cerc 'End DataSource Variables 'DataSource Class_Initialize Event @11-038D0314 Private Sub Class_Initialize() Set CCSEvents = CreateObject("Scripting.Dictionary") Set Fields = New clsFields Set Recordset = New clsDataSource Set Recordset.DataSource = Me Set Errors = New clsErrors Set Connection = Nothing AllParamsSet = True Set Detail_param1 = CCCreateField("Detail_param1", "ID", ccsText, Empty, Recordset) Set den_com = CCCreateField("den_com", "den_com", ccsText, Empty, Recordset) Set dci = CCCreateField("dci", "dci", ccsText, Empty, Recordset) Set forma_farm = CCCreateField("forma_farm", "forma_farm", ccsText, Empty, Recordset) Set cod_atc = CCCreateField("cod_atc", "cod_atc", ccsText, Empty, Recordset) Set cim = CCCreateField("cim", "cim", ccsText, Empty, Recordset) Set firm_tar_d = CCCreateField("firm_tar_d", "firm_tar_d", ccsText, Empty, Recordset) Set bulina = CCCreateField("bulina", "bulina", ccsText, Empty, Recordset) Set diez = CCCreateField("diez", "diez", ccsText, Empty, Recordset) Set stea = CCCreateField("stea", "stea", ccsText, Empty, Recordset) Set triunghi = CCCreateField("triunghi", "triunghi", ccsText, Empty, Recordset) Set cerc = CCCreateField("cerc", "cerc", ccsText, Empty, Recordset) Fields.AddFields Array(Detail_param1, den_com, dci, forma_farm, cod_atc, cim, firm_tar_d, _ bulina, diez, stea, triunghi, cerc) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing Orders = Array( _ Array("Sorter_den_com", "den_com", ""), _ Array("Sorter_dci", "dci", ""), _ Array("Sorter_forma_farm", "forma_farm", ""), _ Array("Sorter_cod_atc", "cod_atc", ""), _ Array("Sorter_cim", "cim", ""), _ Array("Sorter_firm_tar_d", "firm_tar_d", ""), _ Array("Sorter_bulina", "bulina", ""), _ Array("Sorter_diez", "diez", ""), _ Array("Sorter_stea", "stea", ""), _ Array("Sorter_triunghi", "triunghi", ""), _ Array("Sorter_cerc", "cerc", "")) SQL = "SELECT TOP {SqlParam_endRecord} ID, den_com, dci, forma_farm, cod_atc, cim, firm_tar_d, bulina, diez, stea, triunghi, cerc " & vbLf & _ "FROM anm {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM anm" Where = "" Order = "" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'SetOrder Method @11-68FC9576 Sub SetOrder(Column, Direction) Order = Recordset.GetOrder(Order, Column, Direction, Orders) End Sub 'End SetOrder Method 'BuildTableWhere Method @11-F22C45B9 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, "urls_den_com", ccsText, Empty, Empty, Empty, False .AddParameter 2, "urls_dci", ccsText, Empty, Empty, Empty, False .AddParameter 3, "urls_forma_farm", ccsText, Empty, Empty, Empty, False .AddParameter 4, "urls_cod_atc", ccsText, Empty, Empty, Empty, False .AddParameter 5, "urls_cim", ccsText, Empty, Empty, Empty, False .AddParameter 6, "urls_firm_tar_d", ccsText, Empty, Empty, Empty, False .Criterion(1) = .Operation(opContains, False, "den_com", .getParamByID(1)) .Criterion(2) = .Operation(opContains, False, "dci", .getParamByID(2)) .Criterion(3) = .Operation(opContains, False, "forma_farm", .getParamByID(3)) .Criterion(4) = .Operation(opContains, False, "cod_atc", .getParamByID(4)) .Criterion(5) = .Operation(opContains, False, "cim", .getParamByID(5)) .Criterion(6) = .Operation(opContains, False, "firm_tar_d", .getParamByID(6)) .AssembledWhere = .opAND(False, .opAND(False, .opAND(False, .opAND(False, .opAND(False, .Criterion(1), .Criterion(2)), .Criterion(3)), .Criterion(4)), .Criterion(5)), .Criterion(6)) 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 'End BuildTableWhere Method 'Open Method @11-40984FC5 Function Open(Cmd) Errors.Clear If Connection Is Nothing Then Set Open = New clsEmptyDataSource Exit Function End If Set Cmd.Connection = Connection Cmd.CommandOperation = cmdOpen Cmd.PageSize = PageSize Cmd.ActivePage = AbsolutePage Cmd.CommandType = dsTable CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me) Cmd.SQL = SQL Cmd.CountSQL = CountSQL BuildTableWhere Cmd.Where = Where Cmd.OrderBy = Order If(Len(StaticOrder)>0) Then If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy Cmd.OrderBy = StaticOrder + Cmd.OrderBy End If Cmd.Options("TOP") = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me) If Errors.Count = 0 And CCSEventResult Then _ Set Recordset = Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me) Set Recordset.FieldsCollection = Fields Set Open = Recordset End Function 'End Open Method 'DataSource Class_Terminate Event @11-41B4B08D Private Sub Class_Terminate() If Recordset.State = adStateOpen Then _ Recordset.Close Set Recordset = Nothing Set Parameters = Nothing Set Errors = Nothing End Sub 'End DataSource Class_Terminate Event End Class 'End anmDataSource Class @11-A61BA892 %>