HI all.
Have a classic ASP page that takes a searchstring and looks in a table on the server and should bring back any records that are 'like' the searchstring.
Something is going on to where the server just 'hangs' trying to find that data. Only thing I can think of is that the searchstring is a string type and the database field is numeric.
I can search and find on any other field that is character field, but not the "customer number" field. Here is some of what I have and where I am trying to build a search string.
I have tried Cint(SearchString), I have also tried making the field in the DB a character string, but then the leading spaces have to be entered to find the customer number (the field has a length of 6, but most numbers have a length of 4. So, changing the field to character I can only find the number 6048 by entering '(space)(space)6048'.
Any suggestions? Thanks in advance!
Have a classic ASP page that takes a searchstring and looks in a table on the server and should bring back any records that are 'like' the searchstring.
Something is going on to where the server just 'hangs' trying to find that data. Only thing I can think of is that the searchstring is a string type and the database field is numeric.
I can search and find on any other field that is character field, but not the "customer number" field. Here is some of what I have and where I am trying to build a search string.
Code:
Dim oConn, SecondName
Dim oRset, parcel, RecCounter, parcelnum
Dim sel, iPageSize, AddValue, parcelnodash
Dim SearchString, CurrentPage
SearchString = uCase(Request.QueryString("DataSearch"))
SearchString = replace(SearchString, "'", "''")
If Len(SearchString) > 0 Then
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionTimeout = 120
oConn.CommandTimeout = 120
oConn.open "DSN=SCTC_TEST;"
sel = "Select * from arh where cust_num like '" _
& SearchString & "%'"
I have tried Cint(SearchString), I have also tried making the field in the DB a character string, but then the leading spaces have to be entered to find the customer number (the field has a length of 6, but most numbers have a length of 4. So, changing the field to character I can only find the number 6048 by entering '(space)(space)6048'.
Any suggestions? Thanks in advance!