Ask a Question related to ASP Database, Design and Development.
-
Krechting #1
search query doesn't work
Hi ALL,
I have made a record search form with several search options.
However some of them work and others don't. The first four work but
the last six don't.
'WeaponSearch Class_Initialize Event @2-0BECB200
Private Sub Class_Initialize()
Visible = True
Set Errors = New clsErrors
Set CCSEvents = CreateObject("Scripting.Dictionary")
Dim Method
Dim OperationMode
If Visible Then
OperationMode = Split(Request.QueryString("ccsForm"), ":")
If UBound(OperationMode) > -1 Then
FormSubmitted = (OperationMode(0) = "WeaponSearch")
End If
If UBound(OperationMode) > 0 Then
EditMode = (OperationMode(1) = "Edit")
End If
ComponentName = "WeaponSearch"
Method = IIf(FormSubmitted, ccsPost, ccsGet)
Set s_name = CCCreateControl(ccsTextBox, "s_name",
"s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
Set s_categoryDataSource =
CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
"FROM Category", "", "category"))
Set s_category = CCCreateList(ccsListBox, "s_category",
"s_category", ccsText, CCGetRequestParam("s_category", Method),
s_categoryDataSource)
s_category.BoundColumn = "category"
s_category.TextColumn = "category"
Set s_landDataSource =
CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
"FROM Countries", "", "country"))
Set s_land = CCCreateList(ccsListBox, "s_land", "s_land",
ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
s_land.BoundColumn = "country"
s_land.TextColumn = "country"
Set s_taskDataSource =
CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
"FROM Tasks", "", "task"))
Set s_task = CCCreateList(ccsListBox, "s_task", "s_task",
ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
s_task.BoundColumn = "task"
s_task.TextColumn = "task"
Set s_alternative = CCCreateControl(ccsTextBox,
"s_alternative", "s_alternative", ccsText, Empty,
CCGetRequestParam("s_alternative", Method))
Set s_calibreDataSource =
CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
"FROM Calibre", "", "calibre"))
Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
"s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
s_calibreDataSource)
s_calibre.BoundColumn = "calibre"
s_calibre.TextColumn = "calibre"
Set s_range_eff = CCCreateControl(ccsTextBox,
"s_range_eff", "s_range_eff", ccsText, Empty,
CCGetRequestParam("s_range_eff", Method))
Set s_rate_of_fire = CCCreateControl(ccsTextBox,
"s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
CCGetRequestParam("s_rate_of_fire", Method))
Set s_altitude_max = CCCreateControl(ccsTextBox,
"s_altitude_max", "s_altitude_max", ccsText, Empty,
CCGetRequestParam("s_altitude_max", Method))
Set s_max_speed_air = CCCreateControl(ccsTextBox,
"s_max_speed_air", "s_max_speed_air", ccsText, Empty,
CCGetRequestParam("s_max_speed_air", Method))
Set Button1 = CCCreateButton("Button1")
Set Button_DoSearch = CCCreateButton("Button_DoSearch")
Set ValidatingControls = new clsControls
ValidatingControls.addControls Array(s_name, s_category,
s_land, s_task, s_alternative, s_calibre, s_range_eff, s_rate_of_fire,
s_altitude_max, s_max_speed_air)
End If
End Sub
'End WeaponSearch Class_Initialize Event
'WeaponSearch Class_Terminate Event @2-32B847C9
Private Sub Class_Terminate()
Set Errors = Nothing
End Sub
'End WeaponSearch Class_Terminate Event
'WeaponSearch Validate Method @2-7AE5264D
Function Validate()
Dim Validation
Validation = ValidatingControls.Validate
CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
Validate = Validation And (Errors.Count = 0)
End Function
'End WeaponSearch Validate Method
'WeaponSearch Operation Method @2-B3962115
Sub Operation()
If NOT ( Visible AND FormSubmitted ) Then Exit Sub
If FormSubmitted Then
PressedButton = "Button_DoSearch"
If Not IsEmpty(CCGetParam("Button_DoSearch", Empty)) Then
PressedButton = "Button_DoSearch"
End If
End If
Redirect = "Weapon_search.asp"
If Validate() Then
If PressedButton = "Button_DoSearch" Then
If NOT Button_DoSearch.OnClick() Then
Redirect = ""
Else
Redirect = "Weapon_search.asp?" &
CCGetQueryString("Form", Array("Button_DoSearch"))
End If
End If
Else
Redirect = ""
End If
End Sub
'End WeaponSearch Operation Method
regards
Marco
Krechting Guest
-
Simple Query for Search
I have a "States" search form that I want to seach a database. My access database has the query below: SELECT State.Rep, Reps.RepName,... -
How to create a SEARCH by POSTCODE query?
hello! I need to create a search faciltity that will display all postcode records within either 10, 15, 20, 30, 50+ miles from an entered... -
Use results from query to search a different table
Hello, I have a table named inquiries. It contains 1,000 records and continues to grow. I've been asked to take the firstName, and lastName from... -
File Search Query
Hi Been away from php for a few years and I seem to have forgotten everything, I'm doing some stuff on the intranet at work and I would like to... -
search with chinesse font in query ?
hi all, how to made query to search record in field chinesse text ? ex: select * from employe where name like '?%' i was trial it's but not... -
Foo Man Chew #2
Re: search query doesn't work
Which 4 work and which 6 don't? I can't separate things from this code.
Have you considered simplifying to get things working, and then building up,
instead of starting from this monstrosity?
"Krechting" <m.krechting@chello.nl> wrote in message
news:a71c776d.0312300907.5cfcdb0f@posting.google.c om...> Hi ALL,
>
> I have made a record search form with several search options.
> However some of them work and others don't. The first four work but
> the last six don't.
>
> 'WeaponSearch Class_Initialize Event @2-0BECB200
> Private Sub Class_Initialize()
>
> Visible = True
> Set Errors = New clsErrors
> Set CCSEvents = CreateObject("Scripting.Dictionary")
> Dim Method
> Dim OperationMode
>
> If Visible Then
> OperationMode = Split(Request.QueryString("ccsForm"), ":")
> If UBound(OperationMode) > -1 Then
> FormSubmitted = (OperationMode(0) = "WeaponSearch")
> End If
> If UBound(OperationMode) > 0 Then
> EditMode = (OperationMode(1) = "Edit")
> End If
> ComponentName = "WeaponSearch"
> Method = IIf(FormSubmitted, ccsPost, ccsGet)
> Set s_name = CCCreateControl(ccsTextBox, "s_name",
> "s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
> Set s_categoryDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Category", "", "category"))
> Set s_category = CCCreateList(ccsListBox, "s_category",
> "s_category", ccsText, CCGetRequestParam("s_category", Method),
> s_categoryDataSource)
> s_category.BoundColumn = "category"
> s_category.TextColumn = "category"
> Set s_landDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Countries", "", "country"))
> Set s_land = CCCreateList(ccsListBox, "s_land", "s_land",
> ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
> s_land.BoundColumn = "country"
> s_land.TextColumn = "country"
> Set s_taskDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Tasks", "", "task"))
> Set s_task = CCCreateList(ccsListBox, "s_task", "s_task",
> ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
> s_task.BoundColumn = "task"
> s_task.TextColumn = "task"
> Set s_alternative = CCCreateControl(ccsTextBox,
> "s_alternative", "s_alternative", ccsText, Empty,
> CCGetRequestParam("s_alternative", Method))
> Set s_calibreDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Calibre", "", "calibre"))
> Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
> "s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
> s_calibreDataSource)
> s_calibre.BoundColumn = "calibre"
> s_calibre.TextColumn = "calibre"
> Set s_range_eff = CCCreateControl(ccsTextBox,
> "s_range_eff", "s_range_eff", ccsText, Empty,
> CCGetRequestParam("s_range_eff", Method))
> Set s_rate_of_fire = CCCreateControl(ccsTextBox,
> "s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
> CCGetRequestParam("s_rate_of_fire", Method))
> Set s_altitude_max = CCCreateControl(ccsTextBox,
> "s_altitude_max", "s_altitude_max", ccsText, Empty,
> CCGetRequestParam("s_altitude_max", Method))
> Set s_max_speed_air = CCCreateControl(ccsTextBox,
> "s_max_speed_air", "s_max_speed_air", ccsText, Empty,
> CCGetRequestParam("s_max_speed_air", Method))
> Set Button1 = CCCreateButton("Button1")
> Set Button_DoSearch = CCCreateButton("Button_DoSearch")
> Set ValidatingControls = new clsControls
> ValidatingControls.addControls Array(s_name, s_category,
> s_land, s_task, s_alternative, s_calibre, s_range_eff, s_rate_of_fire,
> s_altitude_max, s_max_speed_air)
> End If
> End Sub
> 'End WeaponSearch Class_Initialize Event
>
> 'WeaponSearch Class_Terminate Event @2-32B847C9
> Private Sub Class_Terminate()
> Set Errors = Nothing
> End Sub
> 'End WeaponSearch Class_Terminate Event
>
> 'WeaponSearch Validate Method @2-7AE5264D
> Function Validate()
> Dim Validation
> Validation = ValidatingControls.Validate
> CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
> Validate = Validation And (Errors.Count = 0)
> End Function
> 'End WeaponSearch Validate Method
>
> 'WeaponSearch Operation Method @2-B3962115
> Sub Operation()
> If NOT ( Visible AND FormSubmitted ) Then Exit Sub
>
> If FormSubmitted Then
> PressedButton = "Button_DoSearch"
> If Not IsEmpty(CCGetParam("Button_DoSearch", Empty)) Then
> PressedButton = "Button_DoSearch"
> End If
> End If
> Redirect = "Weapon_search.asp"
> If Validate() Then
> If PressedButton = "Button_DoSearch" Then
> If NOT Button_DoSearch.OnClick() Then
> Redirect = ""
> Else
> Redirect = "Weapon_search.asp?" &
> CCGetQueryString("Form", Array("Button_DoSearch"))
> End If
> End If
> Else
> Redirect = ""
> End If
> End Sub
> 'End WeaponSearch Operation Method
>
> regards
> Marco
Foo Man Chew Guest
-
Ray at #3
Re: search query doesn't work
Could you explain what doesn't work and in what way and which actual code
snippet isn't giving you the results you're after?
Ray at work
"Krechting" <m.krechting@chello.nl> wrote in message
news:a71c776d.0312300907.5cfcdb0f@posting.google.c om...> Hi ALL,
>
> I have made a record search form with several search options.
> However some of them work and others don't. The first four work but
> the last six don't.
>
> 'WeaponSearch Class_Initialize Event @2-0BECB200
> Private Sub Class_Initialize()
>
> Visible = True
> Set Errors = New clsErrors
> Set CCSEvents = CreateObject("Scripting.Dictionary")
> Dim Method
> Dim OperationMode
>
> If Visible Then
> OperationMode = Split(Request.QueryString("ccsForm"), ":")
> If UBound(OperationMode) > -1 Then
> FormSubmitted = (OperationMode(0) = "WeaponSearch")
> End If
> If UBound(OperationMode) > 0 Then
> EditMode = (OperationMode(1) = "Edit")
> End If
> ComponentName = "WeaponSearch"
> Method = IIf(FormSubmitted, ccsPost, ccsGet)
> Set s_name = CCCreateControl(ccsTextBox, "s_name",
> "s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
> Set s_categoryDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Category", "", "category"))
> Set s_category = CCCreateList(ccsListBox, "s_category",
> "s_category", ccsText, CCGetRequestParam("s_category", Method),
> s_categoryDataSource)
> s_category.BoundColumn = "category"
> s_category.TextColumn = "category"
> Set s_landDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Countries", "", "country"))
> Set s_land = CCCreateList(ccsListBox, "s_land", "s_land",
> ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
> s_land.BoundColumn = "country"
> s_land.TextColumn = "country"
> Set s_taskDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Tasks", "", "task"))
> Set s_task = CCCreateList(ccsListBox, "s_task", "s_task",
> ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
> s_task.BoundColumn = "task"
> s_task.TextColumn = "task"
> Set s_alternative = CCCreateControl(ccsTextBox,
> "s_alternative", "s_alternative", ccsText, Empty,
> CCGetRequestParam("s_alternative", Method))
> Set s_calibreDataSource =
> CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> "FROM Calibre", "", "calibre"))
> Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
> "s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
> s_calibreDataSource)
> s_calibre.BoundColumn = "calibre"
> s_calibre.TextColumn = "calibre"
> Set s_range_eff = CCCreateControl(ccsTextBox,
> "s_range_eff", "s_range_eff", ccsText, Empty,
> CCGetRequestParam("s_range_eff", Method))
> Set s_rate_of_fire = CCCreateControl(ccsTextBox,
> "s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
> CCGetRequestParam("s_rate_of_fire", Method))
> Set s_altitude_max = CCCreateControl(ccsTextBox,
> "s_altitude_max", "s_altitude_max", ccsText, Empty,
> CCGetRequestParam("s_altitude_max", Method))
> Set s_max_speed_air = CCCreateControl(ccsTextBox,
> "s_max_speed_air", "s_max_speed_air", ccsText, Empty,
> CCGetRequestParam("s_max_speed_air", Method))
> Set Button1 = CCCreateButton("Button1")
> Set Button_DoSearch = CCCreateButton("Button_DoSearch")
> Set ValidatingControls = new clsControls
> ValidatingControls.addControls Array(s_name, s_category,
> s_land, s_task, s_alternative, s_calibre, s_range_eff, s_rate_of_fire,
> s_altitude_max, s_max_speed_air)
> End If
> End Sub
> 'End WeaponSearch Class_Initialize Event
>
> 'WeaponSearch Class_Terminate Event @2-32B847C9
> Private Sub Class_Terminate()
> Set Errors = Nothing
> End Sub
> 'End WeaponSearch Class_Terminate Event
>
> 'WeaponSearch Validate Method @2-7AE5264D
> Function Validate()
> Dim Validation
> Validation = ValidatingControls.Validate
> CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
> Validate = Validation And (Errors.Count = 0)
> End Function
> 'End WeaponSearch Validate Method
>
> 'WeaponSearch Operation Method @2-B3962115
> Sub Operation()
> If NOT ( Visible AND FormSubmitted ) Then Exit Sub
>
> If FormSubmitted Then
> PressedButton = "Button_DoSearch"
> If Not IsEmpty(CCGetParam("Button_DoSearch", Empty)) Then
> PressedButton = "Button_DoSearch"
> End If
> End If
> Redirect = "Weapon_search.asp"
> If Validate() Then
> If PressedButton = "Button_DoSearch" Then
> If NOT Button_DoSearch.OnClick() Then
> Redirect = ""
> Else
> Redirect = "Weapon_search.asp?" &
> CCGetQueryString("Form", Array("Button_DoSearch"))
> End If
> End If
> Else
> Redirect = ""
> End If
> End Sub
> 'End WeaponSearch Operation Method
>
> regards
> Marco
Ray at Guest
-
Krechting #4
Re: search query doesn't work
Sorry guys,
New in the business.
The first four work, so name, category, task and name.
The rest is not working, so from alternative on.
I don't know what the problem is since the query string looks fine.
Marco
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:<ueKhPfvzDHA.1100@TK2MSFTNGP10.phx.gbl>...> Could you explain what doesn't work and in what way and which actual code
> snippet isn't giving you the results you're after?
>
> Ray at work
>
> "Krechting" <m.krechting@chello.nl> wrote in message
> news:a71c776d.0312300907.5cfcdb0f@posting.google.c om...> > Hi ALL,
> >
> > I have made a record search form with several search options.
> > However some of them work and others don't. The first four work but
> > the last six don't.
> >
> > 'WeaponSearch Class_Initialize Event @2-0BECB200
> > Private Sub Class_Initialize()
> >
> > Visible = True
> > Set Errors = New clsErrors
> > Set CCSEvents = CreateObject("Scripting.Dictionary")
> > Dim Method
> > Dim OperationMode
> >
> > If Visible Then
> > OperationMode = Split(Request.QueryString("ccsForm"), ":")
> > If UBound(OperationMode) > -1 Then
> > FormSubmitted = (OperationMode(0) = "WeaponSearch")
> > End If
> > If UBound(OperationMode) > 0 Then
> > EditMode = (OperationMode(1) = "Edit")
> > End If
> > ComponentName = "WeaponSearch"
> > Method = IIf(FormSubmitted, ccsPost, ccsGet)
> > Set s_name = CCCreateControl(ccsTextBox, "s_name",
> > "s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
> > Set s_categoryDataSource =
> > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > "FROM Category", "", "category"))
> > Set s_category = CCCreateList(ccsListBox, "s_category",
> > "s_category", ccsText, CCGetRequestParam("s_category", Method),
> > s_categoryDataSource)
> > s_category.BoundColumn = "category"
> > s_category.TextColumn = "category"
> > Set s_landDataSource =
> > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > "FROM Countries", "", "country"))
> > Set s_land = CCCreateList(ccsListBox, "s_land", "s_land",
> > ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
> > s_land.BoundColumn = "country"
> > s_land.TextColumn = "country"
> > Set s_taskDataSource =
> > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > "FROM Tasks", "", "task"))
> > Set s_task = CCCreateList(ccsListBox, "s_task", "s_task",
> > ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
> > s_task.BoundColumn = "task"
> > s_task.TextColumn = "task"
> > Set s_alternative = CCCreateControl(ccsTextBox,
> > "s_alternative", "s_alternative", ccsText, Empty,
> > CCGetRequestParam("s_alternative", Method))
> > Set s_calibreDataSource =
> > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > "FROM Calibre", "", "calibre"))
> > Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
> > "s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
> > s_calibreDataSource)
> > s_calibre.BoundColumn = "calibre"
> > s_calibre.TextColumn = "calibre"
> > Set s_range_eff = CCCreateControl(ccsTextBox,
> > "s_range_eff", "s_range_eff", ccsText, Empty,
> > CCGetRequestParam("s_range_eff", Method))
> > Set s_rate_of_fire = CCCreateControl(ccsTextBox,
> > "s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
> > CCGetRequestParam("s_rate_of_fire", Method))
> > Set s_altitude_max = CCCreateControl(ccsTextBox,
> > "s_altitude_max", "s_altitude_max", ccsText, Empty,
> > CCGetRequestParam("s_altitude_max", Method))
> > Set s_max_speed_air = CCCreateControl(ccsTextBox,
> > "s_max_speed_air", "s_max_speed_air", ccsText, Empty,
> > CCGetRequestParam("s_max_speed_air", Method))
> > Set Button1 = CCCreateButton("Button1")
> > Set Button_DoSearch = CCCreateButton("Button_DoSearch")
> > Set ValidatingControls = new clsControls
> > ValidatingControls.addControls Array(s_name, s_category,
> > s_land, s_task, s_alternative, s_calibre, s_range_eff, s_rate_of_fire,
> > s_altitude_max, s_max_speed_air)
> > End If
> > End Sub
> > 'End WeaponSearch Class_Initialize Event
> >
> > 'WeaponSearch Class_Terminate Event @2-32B847C9
> > Private Sub Class_Terminate()
> > Set Errors = Nothing
> > End Sub
> > 'End WeaponSearch Class_Terminate Event
> >
> > 'WeaponSearch Validate Method @2-7AE5264D
> > Function Validate()
> > Dim Validation
> > Validation = ValidatingControls.Validate
> > CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
> > Validate = Validation And (Errors.Count = 0)
> > End Function
> > 'End WeaponSearch Validate Method
> >
> > 'WeaponSearch Operation Method @2-B3962115
> > Sub Operation()
> > If NOT ( Visible AND FormSubmitted ) Then Exit Sub
> >
> > If FormSubmitted Then
> > PressedButton = "Button_DoSearch"
> > If Not IsEmpty(CCGetParam("Button_DoSearch", Empty)) Then
> > PressedButton = "Button_DoSearch"
> > End If
> > End If
> > Redirect = "Weapon_search.asp"
> > If Validate() Then
> > If PressedButton = "Button_DoSearch" Then
> > If NOT Button_DoSearch.OnClick() Then
> > Redirect = ""
> > Else
> > Redirect = "Weapon_search.asp?" &
> > CCGetQueryString("Form", Array("Button_DoSearch"))
> > End If
> > End If
> > Else
> > Redirect = ""
> > End If
> > End Sub
> > 'End WeaponSearch Operation Method
> >
> > regards
> > MarcoKrechting Guest
-
Ray at #5
Re: search query doesn't work
Can you include only the individual code snippet that isn't working and then
also describe what you mean when you say it's not working? Do you get an
error? Do you get unexpected results? Etc.
Ray at work
"Krechting" <m.krechting@chello.nl> wrote in message
news:a71c776d.0312310111.4bfc4a02@posting.google.c om...news:<ueKhPfvzDHA.1100@TK2MSFTNGP10.phx.gbl>...> Sorry guys,
>
> New in the business.
> The first four work, so name, category, task and name.
> The rest is not working, so from alternative on.
> I don't know what the problem is since the query string looks fine.
>
> Marco
>
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in messagecode> > Could you explain what doesn't work and in what way and which actual> > snippet isn't giving you the results you're after?
> >
> > Ray at work
> >
> > "Krechting" <m.krechting@chello.nl> wrote in message
> > news:a71c776d.0312300907.5cfcdb0f@posting.google.c om...> > > Hi ALL,
> > >
> > > I have made a record search form with several search options.
> > > However some of them work and others don't. The first four work but
> > > the last six don't.
> > >
> > > 'WeaponSearch Class_Initialize Event @2-0BECB200
> > > Private Sub Class_Initialize()
> > >
> > > Visible = True
> > > Set Errors = New clsErrors
> > > Set CCSEvents = CreateObject("Scripting.Dictionary")
> > > Dim Method
> > > Dim OperationMode
> > >
> > > If Visible Then
> > > OperationMode = Split(Request.QueryString("ccsForm"), ":")
> > > If UBound(OperationMode) > -1 Then
> > > FormSubmitted = (OperationMode(0) = "WeaponSearch")
> > > End If
> > > If UBound(OperationMode) > 0 Then
> > > EditMode = (OperationMode(1) = "Edit")
> > > End If
> > > ComponentName = "WeaponSearch"
> > > Method = IIf(FormSubmitted, ccsPost, ccsGet)
> > > Set s_name = CCCreateControl(ccsTextBox, "s_name",
> > > "s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
> > > Set s_categoryDataSource =
> > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > "FROM Category", "", "category"))
> > > Set s_category = CCCreateList(ccsListBox, "s_category",
> > > "s_category", ccsText, CCGetRequestParam("s_category", Method),
> > > s_categoryDataSource)
> > > s_category.BoundColumn = "category"
> > > s_category.TextColumn = "category"
> > > Set s_landDataSource =
> > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > "FROM Countries", "", "country"))
> > > Set s_land = CCCreateList(ccsListBox, "s_land", "s_land",
> > > ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
> > > s_land.BoundColumn = "country"
> > > s_land.TextColumn = "country"
> > > Set s_taskDataSource =
> > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > "FROM Tasks", "", "task"))
> > > Set s_task = CCCreateList(ccsListBox, "s_task", "s_task",
> > > ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
> > > s_task.BoundColumn = "task"
> > > s_task.TextColumn = "task"
> > > Set s_alternative = CCCreateControl(ccsTextBox,
> > > "s_alternative", "s_alternative", ccsText, Empty,
> > > CCGetRequestParam("s_alternative", Method))
> > > Set s_calibreDataSource =
> > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > "FROM Calibre", "", "calibre"))
> > > Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
> > > "s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
> > > s_calibreDataSource)
> > > s_calibre.BoundColumn = "calibre"
> > > s_calibre.TextColumn = "calibre"
> > > Set s_range_eff = CCCreateControl(ccsTextBox,
> > > "s_range_eff", "s_range_eff", ccsText, Empty,
> > > CCGetRequestParam("s_range_eff", Method))
> > > Set s_rate_of_fire = CCCreateControl(ccsTextBox,
> > > "s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
> > > CCGetRequestParam("s_rate_of_fire", Method))
> > > Set s_altitude_max = CCCreateControl(ccsTextBox,
> > > "s_altitude_max", "s_altitude_max", ccsText, Empty,
> > > CCGetRequestParam("s_altitude_max", Method))
> > > Set s_max_speed_air = CCCreateControl(ccsTextBox,
> > > "s_max_speed_air", "s_max_speed_air", ccsText, Empty,
> > > CCGetRequestParam("s_max_speed_air", Method))
> > > Set Button1 = CCCreateButton("Button1")
> > > Set Button_DoSearch = CCCreateButton("Button_DoSearch")
> > > Set ValidatingControls = new clsControls
> > > ValidatingControls.addControls Array(s_name, s_category,
> > > s_land, s_task, s_alternative, s_calibre, s_range_eff, s_rate_of_fire,
> > > s_altitude_max, s_max_speed_air)
> > > End If
> > > End Sub
> > > 'End WeaponSearch Class_Initialize Event
> > >
> > > 'WeaponSearch Class_Terminate Event @2-32B847C9
> > > Private Sub Class_Terminate()
> > > Set Errors = Nothing
> > > End Sub
> > > 'End WeaponSearch Class_Terminate Event
> > >
> > > 'WeaponSearch Validate Method @2-7AE5264D
> > > Function Validate()
> > > Dim Validation
> > > Validation = ValidatingControls.Validate
> > > CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
> > > Validate = Validation And (Errors.Count = 0)
> > > End Function
> > > 'End WeaponSearch Validate Method
> > >
> > > 'WeaponSearch Operation Method @2-B3962115
> > > Sub Operation()
> > > If NOT ( Visible AND FormSubmitted ) Then Exit Sub
> > >
> > > If FormSubmitted Then
> > > PressedButton = "Button_DoSearch"
> > > If Not IsEmpty(CCGetParam("Button_DoSearch", Empty)) Then
> > > PressedButton = "Button_DoSearch"
> > > End If
> > > End If
> > > Redirect = "Weapon_search.asp"
> > > If Validate() Then
> > > If PressedButton = "Button_DoSearch" Then
> > > If NOT Button_DoSearch.OnClick() Then
> > > Redirect = ""
> > > Else
> > > Redirect = "Weapon_search.asp?" &
> > > CCGetQueryString("Form", Array("Button_DoSearch"))
> > > End If
> > > End If
> > > Else
> > > Redirect = ""
> > > End If
> > > End Sub
> > > 'End WeaponSearch Operation Method
> > >
> > > regards
> > > Marco
Ray at Guest
-
Krechting #6
Re: search query doesn't work
Ray,
I'm not sure where it goes wrong because I'm new at this code and
it's more or less created by codecharge.
What I can tell you is that with the fields that don't work it doesn't
matter what I type in it will always return all the records in the db.
Marco
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:<ub$MWL6zDHA.536@tk2msftngp13.phx.gbl>...> Can you include only the individual code snippet that isn't working and then
> also describe what you mean when you say it's not working? Do you get an
> error? Do you get unexpected results? Etc.
>
> Ray at work
>
> "Krechting" <m.krechting@chello.nl> wrote in message
> news:a71c776d.0312310111.4bfc4a02@posting.google.c om...> news:<ueKhPfvzDHA.1100@TK2MSFTNGP10.phx.gbl>...> > Sorry guys,
> >
> > New in the business.
> > The first four work, so name, category, task and name.
> > The rest is not working, so from alternative on.
> > I don't know what the problem is since the query string looks fine.
> >
> > Marco
> >
> > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message> code> > > Could you explain what doesn't work and in what way and which actual> > > snippet isn't giving you the results you're after?
> > >
> > > Ray at work
> > >
> > > "Krechting" <m.krechting@chello.nl> wrote in message
> > > news:a71c776d.0312300907.5cfcdb0f@posting.google.c om...
> > > > Hi ALL,
> > > >
> > > > I have made a record search form with several search options.
> > > > However some of them work and others don't. The first four work but
> > > > the last six don't.
> > > >
> > > > 'WeaponSearch Class_Initialize Event @2-0BECB200
> > > > Private Sub Class_Initialize()
> > > >
> > > > Visible = True
> > > > Set Errors = New clsErrors
> > > > Set CCSEvents = CreateObject("Scripting.Dictionary")
> > > > Dim Method
> > > > Dim OperationMode
> > > >
> > > > If Visible Then
> > > > OperationMode = Split(Request.QueryString("ccsForm"), ":")
> > > > If UBound(OperationMode) > -1 Then
> > > > FormSubmitted = (OperationMode(0) = "WeaponSearch")
> > > > End If
> > > > If UBound(OperationMode) > 0 Then
> > > > EditMode = (OperationMode(1) = "Edit")
> > > > End If
> > > > ComponentName = "WeaponSearch"
> > > > Method = IIf(FormSubmitted, ccsPost, ccsGet)
> > > > Set s_name = CCCreateControl(ccsTextBox, "s_name",
> > > > "s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
> > > > Set s_categoryDataSource =
> > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > "FROM Category", "", "category"))
> > > > Set s_category = CCCreateList(ccsListBox, "s_category",
> > > > "s_category", ccsText, CCGetRequestParam("s_category", Method),
> > > > s_categoryDataSource)
> > > > s_category.BoundColumn = "category"
> > > > s_category.TextColumn = "category"
> > > > Set s_landDataSource =
> > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > "FROM Countries", "", "country"))
> > > > Set s_land = CCCreateList(ccsListBox, "s_land", "s_land",
> > > > ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
> > > > s_land.BoundColumn = "country"
> > > > s_land.TextColumn = "country"
> > > > Set s_taskDataSource =
> > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > "FROM Tasks", "", "task"))
> > > > Set s_task = CCCreateList(ccsListBox, "s_task", "s_task",
> > > > ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
> > > > s_task.BoundColumn = "task"
> > > > s_task.TextColumn = "task"
> > > > Set s_alternative = CCCreateControl(ccsTextBox,
> > > > "s_alternative", "s_alternative", ccsText, Empty,
> > > > CCGetRequestParam("s_alternative", Method))
> > > > Set s_calibreDataSource =
> > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > "FROM Calibre", "", "calibre"))
> > > > Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
> > > > "s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
> > > > s_calibreDataSource)
> > > > s_calibre.BoundColumn = "calibre"
> > > > s_calibre.TextColumn = "calibre"
> > > > Set s_range_eff = CCCreateControl(ccsTextBox,
> > > > "s_range_eff", "s_range_eff", ccsText, Empty,
> > > > CCGetRequestParam("s_range_eff", Method))
> > > > Set s_rate_of_fire = CCCreateControl(ccsTextBox,
> > > > "s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
> > > > CCGetRequestParam("s_rate_of_fire", Method))
> > > > Set s_altitude_max = CCCreateControl(ccsTextBox,
> > > > "s_altitude_max", "s_altitude_max", ccsText, Empty,
> > > > CCGetRequestParam("s_altitude_max", Method))
> > > > Set s_max_speed_air = CCCreateControl(ccsTextBox,
> > > > "s_max_speed_air", "s_max_speed_air", ccsText, Empty,
> > > > CCGetRequestParam("s_max_speed_air", Method))
> > > > Set Button1 = CCCreateButton("Button1")
> > > > Set Button_DoSearch = CCCreateButton("Button_DoSearch")
> > > > Set ValidatingControls = new clsControls
> > > > ValidatingControls.addControls Array(s_name, s_category,
> > > > s_land, s_task, s_alternative, s_calibre, s_range_eff, s_rate_of_fire,
> > > > s_altitude_max, s_max_speed_air)
> > > > End If
> > > > End Sub
> > > > 'End WeaponSearch Class_Initialize Event
> > > >
> > > > 'WeaponSearch Class_Terminate Event @2-32B847C9
> > > > Private Sub Class_Terminate()
> > > > Set Errors = Nothing
> > > > End Sub
> > > > 'End WeaponSearch Class_Terminate Event
> > > >
> > > > 'WeaponSearch Validate Method @2-7AE5264D
> > > > Function Validate()
> > > > Dim Validation
> > > > Validation = ValidatingControls.Validate
> > > > CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
> > > > Validate = Validation And (Errors.Count = 0)
> > > > End Function
> > > > 'End WeaponSearch Validate Method
> > > >
> > > > 'WeaponSearch Operation Method @2-B3962115
> > > > Sub Operation()
> > > > If NOT ( Visible AND FormSubmitted ) Then Exit Sub
> > > >
> > > > If FormSubmitted Then
> > > > PressedButton = "Button_DoSearch"
> > > > If Not IsEmpty(CCGetParam("Button_DoSearch", Empty)) Then
> > > > PressedButton = "Button_DoSearch"
> > > > End If
> > > > End If
> > > > Redirect = "Weapon_search.asp"
> > > > If Validate() Then
> > > > If PressedButton = "Button_DoSearch" Then
> > > > If NOT Button_DoSearch.OnClick() Then
> > > > Redirect = ""
> > > > Else
> > > > Redirect = "Weapon_search.asp?" &
> > > > CCGetQueryString("Form", Array("Button_DoSearch"))
> > > > End If
> > > > End If
> > > > Else
> > > > Redirect = ""
> > > > End If
> > > > End Sub
> > > > 'End WeaponSearch Operation Method
> > > >
> > > > regards
> > > > MarcoKrechting Guest
-
Mark Schupp #7
Re: search query doesn't work
Trim your code down to the simplest example that "doesn't work" and post the
code here.
Include data from the table being searched and the input data that results
in the bad behavior.
--
Mark Schupp
Head of Development
Integrity eLearning
[url]www.ielearning.com[/url]
"Krechting" <m.krechting@chello.nl> wrote in message
news:a71c776d.0401010155.1fa64f3a@posting.google.c om...news:<ub$MWL6zDHA.536@tk2msftngp13.phx.gbl>...> Ray,
>
> I'm not sure where it goes wrong because I'm new at this code and
> it's more or less created by codecharge.
> What I can tell you is that with the fields that don't work it doesn't
> matter what I type in it will always return all the records in the db.
>
> Marco
>
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in messagethen> > Can you include only the individual code snippet that isn't working andan> > also describe what you mean when you say it's not working? Do you getmessage> > error? Do you get unexpected results? Etc.
> >
> > Ray at work
> >
> > "Krechting" <m.krechting@chello.nl> wrote in message
> > news:a71c776d.0312310111.4bfc4a02@posting.google.c om...> > > Sorry guys,
> > >
> > > New in the business.
> > > The first four work, so name, category, task and name.
> > > The rest is not working, so from alternative on.
> > > I don't know what the problem is since the query string looks fine.
> > >
> > > Marco
> > >
> > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote inbut> > news:<ueKhPfvzDHA.1100@TK2MSFTNGP10.phx.gbl>...> > code> > > > Could you explain what doesn't work and in what way and which actual> > > > snippet isn't giving you the results you're after?
> > > >
> > > > Ray at work
> > > >
> > > > "Krechting" <m.krechting@chello.nl> wrote in message
> > > > news:a71c776d.0312300907.5cfcdb0f@posting.google.c om...
> > > > > Hi ALL,
> > > > >
> > > > > I have made a record search form with several search options.
> > > > > However some of them work and others don't. The first four work":")> > > > > the last six don't.
> > > > >
> > > > > 'WeaponSearch Class_Initialize Event @2-0BECB200
> > > > > Private Sub Class_Initialize()
> > > > >
> > > > > Visible = True
> > > > > Set Errors = New clsErrors
> > > > > Set CCSEvents = CreateObject("Scripting.Dictionary")
> > > > > Dim Method
> > > > > Dim OperationMode
> > > > >
> > > > > If Visible Then
> > > > > OperationMode = Split(Request.QueryString("ccsForm"),"WeaponSearch")> > > > > If UBound(OperationMode) > -1 Then
> > > > > FormSubmitted = (OperationMode(0) ="s_category",> > > > > End If
> > > > > If UBound(OperationMode) > 0 Then
> > > > > EditMode = (OperationMode(1) = "Edit")
> > > > > End If
> > > > > ComponentName = "WeaponSearch"
> > > > > Method = IIf(FormSubmitted, ccsPost, ccsGet)
> > > > > Set s_name = CCCreateControl(ccsTextBox, "s_name",
> > > > > "s_name", ccsText, Empty, CCGetRequestParam("s_name", Method))
> > > > > Set s_categoryDataSource =
> > > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > > "FROM Category", "", "category"))
> > > > > Set s_category = CCCreateList(ccsListBox,"s_land",> > > > > "s_category", ccsText, CCGetRequestParam("s_category", Method),
> > > > > s_categoryDataSource)
> > > > > s_category.BoundColumn = "category"
> > > > > s_category.TextColumn = "category"
> > > > > Set s_landDataSource =
> > > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > > "FROM Countries", "", "country"))
> > > > > Set s_land = CCCreateList(ccsListBox, "s_land","s_task",> > > > > ccsText, CCGetRequestParam("s_land", Method), s_landDataSource)
> > > > > s_land.BoundColumn = "country"
> > > > > s_land.TextColumn = "country"
> > > > > Set s_taskDataSource =
> > > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > > "FROM Tasks", "", "task"))
> > > > > Set s_task = CCCreateList(ccsListBox, "s_task",CCCreateButton("Button_DoSearch")> > > > > ccsText, CCGetRequestParam("s_task", Method), s_taskDataSource)
> > > > > s_task.BoundColumn = "task"
> > > > > s_task.TextColumn = "task"
> > > > > Set s_alternative = CCCreateControl(ccsTextBox,
> > > > > "s_alternative", "s_alternative", ccsText, Empty,
> > > > > CCGetRequestParam("s_alternative", Method))
> > > > > Set s_calibreDataSource =
> > > > > CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _
> > > > > "FROM Calibre", "", "calibre"))
> > > > > Set s_calibre = CCCreateList(ccsListBox, "s_calibre",
> > > > > "s_calibre", ccsInteger, CCGetRequestParam("s_calibre", Method),
> > > > > s_calibreDataSource)
> > > > > s_calibre.BoundColumn = "calibre"
> > > > > s_calibre.TextColumn = "calibre"
> > > > > Set s_range_eff = CCCreateControl(ccsTextBox,
> > > > > "s_range_eff", "s_range_eff", ccsText, Empty,
> > > > > CCGetRequestParam("s_range_eff", Method))
> > > > > Set s_rate_of_fire = CCCreateControl(ccsTextBox,
> > > > > "s_rate_of_fire", "s_rate_of_fire", ccsText, Empty,
> > > > > CCGetRequestParam("s_rate_of_fire", Method))
> > > > > Set s_altitude_max = CCCreateControl(ccsTextBox,
> > > > > "s_altitude_max", "s_altitude_max", ccsText, Empty,
> > > > > CCGetRequestParam("s_altitude_max", Method))
> > > > > Set s_max_speed_air = CCCreateControl(ccsTextBox,
> > > > > "s_max_speed_air", "s_max_speed_air", ccsText, Empty,
> > > > > CCGetRequestParam("s_max_speed_air", Method))
> > > > > Set Button1 = CCCreateButton("Button1")
> > > > > Set Button_DoSearch =s_category,> > > > > Set ValidatingControls = new clsControls
> > > > > ValidatingControls.addControls Array(s_name,s_rate_of_fire,> > > > > s_land, s_task, s_alternative, s_calibre, s_range_eff,Then> > > > > s_altitude_max, s_max_speed_air)
> > > > > End If
> > > > > End Sub
> > > > > 'End WeaponSearch Class_Initialize Event
> > > > >
> > > > > 'WeaponSearch Class_Terminate Event @2-32B847C9
> > > > > Private Sub Class_Terminate()
> > > > > Set Errors = Nothing
> > > > > End Sub
> > > > > 'End WeaponSearch Class_Terminate Event
> > > > >
> > > > > 'WeaponSearch Validate Method @2-7AE5264D
> > > > > Function Validate()
> > > > > Dim Validation
> > > > > Validation = ValidatingControls.Validate
> > > > > CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
> > > > > Validate = Validation And (Errors.Count = 0)
> > > > > End Function
> > > > > 'End WeaponSearch Validate Method
> > > > >
> > > > > 'WeaponSearch Operation Method @2-B3962115
> > > > > Sub Operation()
> > > > > If NOT ( Visible AND FormSubmitted ) Then Exit Sub
> > > > >
> > > > > If FormSubmitted Then
> > > > > PressedButton = "Button_DoSearch"
> > > > > If Not IsEmpty(CCGetParam("Button_DoSearch", Empty))> > > > > PressedButton = "Button_DoSearch"
> > > > > End If
> > > > > End If
> > > > > Redirect = "Weapon_search.asp"
> > > > > If Validate() Then
> > > > > If PressedButton = "Button_DoSearch" Then
> > > > > If NOT Button_DoSearch.OnClick() Then
> > > > > Redirect = ""
> > > > > Else
> > > > > Redirect = "Weapon_search.asp?" &
> > > > > CCGetQueryString("Form", Array("Button_DoSearch"))
> > > > > End If
> > > > > End If
> > > > > Else
> > > > > Redirect = ""
> > > > > End If
> > > > > End Sub
> > > > > 'End WeaponSearch Operation Method
> > > > >
> > > > > regards
> > > > > Marco
Mark Schupp Guest



Reply With Quote

