•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 361,619 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,190 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1879 | Replies: 45 | Solved
![]() |
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
Sorry to say this, yes
Have no experience at all in ASP.NET. I have this in planning schedule but it doesn't help much for now :-). Using traditional vbscript coding in ASP.NET maybe isn't the best for performance ?
I have some new code that I going to throw up here soon with separators and comments. It might be the last try on this. If you have a minute later to throw an professional eyeball on that would be more than welcome.
/
And I will send you a message later as I promised earlier about an idea in business. Your have probably lot's of work going on already but I'll take my chances.
Have no experience at all in ASP.NET. I have this in planning schedule but it doesn't help much for now :-). Using traditional vbscript coding in ASP.NET maybe isn't the best for performance ?
I have some new code that I going to throw up here soon with separators and comments. It might be the last try on this. If you have a minute later to throw an professional eyeball on that would be more than welcome.
/
And I will send you a message later as I promised earlier about an idea in business. Your have probably lot's of work going on already but I'll take my chances.
Last edited by TobbeK : Mar 7th, 2008 at 10:38 am.
•
•
Join Date: Sep 2007
Posts: 1,051
Reputation:
Rep Power: 3
Solved Threads: 60
Actually vbscript/vb.net works the same in asp.net.
It's not much of a conversion, and is much easier to do in vb.net than regular vbscript.
However, it would take time to learn the controls of asp.net, but it is definitely worth it and will save you more coding than you think ^^
Sure, shoot with whatever you got.
It's not much of a conversion, and is much easier to do in vb.net than regular vbscript.
However, it would take time to learn the controls of asp.net, but it is definitely worth it and will save you more coding than you think ^^
Sure, shoot with whatever you got.
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
The final try on this, before find some other approach to it.
I works sometimes, and orther time some results are strange when spaces are present or not.
What I have try to achive here is to concatenate the streetadress with streetnumber. It doesn't work very well.
The purpose of the possibility to do searches like this is to actually return what the user ask for, a more detailed question will return more exact hits
Example:
A string like this is containing very exact information for db search.
whereinput = "Coldstreet, 123A, 12345, Freezytown"
A string like this is just as exact for db search.
whereinput = "Coldstreet, 123A,12345"
Less exact but enough for db search
whereinput = "Coldstreet, 123A"
Or
whereinput = "12345"
Or
whereinput = "12345, Freezytown"
Or
whereinput = "Freezytown"
Also
I have created a variable (hybrid) for different inputs which can be either city, county or state
I works sometimes, and orther time some results are strange when spaces are present or not.
What I have try to achive here is to concatenate the streetadress with streetnumber. It doesn't work very well.
The purpose of the possibility to do searches like this is to actually return what the user ask for, a more detailed question will return more exact hits
Example:
A string like this is containing very exact information for db search.
whereinput = "Coldstreet, 123A, 12345, Freezytown"
A string like this is just as exact for db search.
whereinput = "Coldstreet, 123A,12345"
Less exact but enough for db search
whereinput = "Coldstreet, 123A"
Or
whereinput = "12345"
Or
whereinput = "12345, Freezytown"
Or
whereinput = "Freezytown"
Also
I have created a variable (hybrid) for different inputs which can be either city, county or state
whereinput = "Coldstreet, 123A, 12345, Freezytown"
whereinput = Trim(whereinput)
where = Split(whereinput, ",")
For i = 0 to Ubound(where)
If i = 0 AND i < UBound(where) AND IsNumeric(where(i)) = False Then
Session("where") = where(i)
adress = session("where")
ElseIf adress <> "" AND i = 1 AND i < UBound(where) AND IsNumeric(Left(where(i),1)) = True AND Len(where(i)) < 5 Then
Session("where") = where(i)
gatunr = session("where")
adress = adress &" "& streetnumber
Response.Write i & " = Adress: " & adress & "<br>"
ElseIf adress = "" AND i < UBound(where) AND IsNumeric(Left(where(i),1)) = True AND Len(where(i)) < 5 Then
Session("where") = where(i)
streetnumber = session("where")
adress = streetnumber
Response.Write i & " = Adress: " & adress & "<br>"
End If
If i < UBound(where) AND (IsNumeric(where(i)) = True) AND Len(where(i)) >= 5 Then
Response.Write i & " = Postnr: " & where(i) & "<br>"
Session("where") = where(i)
zipcode = session("where")
ElseIf i = UBound(where) AND (IsNumeric(where(i)) = True) AND Len(where(i)) >= 5 Then
Response.Write i & " = Postnr: " & where(i) & "<br>"
Session("where") = where(i)
zipcode = session("where")
End If
If i > 0 AND i = UBound(where) AND IsNumeric(Left(where(i),1)) = False Then
Response.Write i & " = City: " & where(i) & "<br>"
Session("where") = where(i)
hybrid = session("where")
ElseIf i = 0 AND i = UBound(where) AND IsNumeric(Left(where(i),1)) = False Then
Response.Write i & " = Address/City/County/State: " & where(i) & "<br>"
Session("where") = where(i)
hybrid = session("where")
End If
Next
If InStr(zipcode," ") <> 0 Then
zipcode = Replace(zipcode," ","[\ ]?")
End If
SQL = "SELECT CL.organisation, CA.address,CA.zipcode,CA.city,RG.state,RG.stateID,KO.county,KO.countyID "&_
"FROM tbclientaddress CA "&_
"JOIN tbclients CL ON CA.clientlink = CL.clientID "&_
"JOIN tbstate RG ON CA.state = RG.stateID "&_
"JOIN tbcounty KO ON CA.county = KO.countyID "&_
"WHERE (REPLACE(CL.searchwords,'-','') REGEXP '[[:<:]]"&what&"'" &_
"OR REPLACE(CA.phone,'-','') REGEXP '[[:<:]]"&what&"'" &_
"OR REPLACE(CL.organisation,'-','') REGEXP '[[:<:]]"&what&"')" &_
"AND (REPLACE(CA.address,' ','') REGEXP '[[:<:]]"&address&"' "&_
"AND REPLACE(CA.zipcode,' ','') REGEXP '[[:<:]]"&zipcode&"' )" &_
"AND (REPLACE(CA.city,'-','') REGEXP '[[:<:]]"&hybrid&"' " &_
"OR REPLACE(KO.county,'-','') REGEXP '[[:<:]]"&hybrid&"' " &_
"OR REPLACE(RG.state,'-','') REGEXP '[[:<:]]"&hybrid&"') "
Set RS = Server.CreateObject("ADODB.recordset")
RS.Open SQL,Conn
Do While Not RS.EOF
etc ... etc ... Last edited by TobbeK : Mar 7th, 2008 at 12:47 pm.
•
•
Join Date: Feb 2008
Posts: 135
Reputation:
Rep Power: 1
Solved Threads: 3
The final .... (probably)
Now it is actually does what it should.
Any input combination is handled as it is supposed to.
Even an an input like this is separated in the manner it should.
whereinput = "Cold street 123 A 123 45"
Output:
Cold street 123 A
123 45
I have played a bit with the index and the values stays at the same index positions but are placed into different variables.
Everything seems to work. I still have one piece left, and that is the cityname that can appear at the very end of the string or by it's own. I havn't figured that out yet, and hopefully I get some help with that.
The streetname alone or a cityname alone should populate a variable named hybrid.
If there is any spaces in that string the first substring populate streetname second substring the hybrid variable.
Now it is actually does what it should.
Any input combination is handled as it is supposed to.
Even an an input like this is separated in the manner it should.
whereinput = "Cold street 123 A 123 45"
Output:
Cold street 123 A
123 45
I have played a bit with the index and the values stays at the same index positions but are placed into different variables.
Everything seems to work. I still have one piece left, and that is the cityname that can appear at the very end of the string or by it's own. I havn't figured that out yet, and hopefully I get some help with that.
The streetname alone or a cityname alone should populate a variable named hybrid.
If there is any spaces in that string the first substring populate streetname second substring the hybrid variable.
whereinput = "Cold street 123 A 123 45"
whereinput = Trim(whereinput)
where = Split(whereinput, " ")
For i = 0 To UBound(where)
If i = 0 AND i = Ubound(where) AND IsNumeric(where) = False Then
hybrid = where(i)
ElseIf i = 0 AND i < Ubound(where) AND IsNumeric(where) = False Then
streetname = where(i)
ElseIf i = 1 AND i < Ubound(where) AND IsNumeric(where) = False Then
streetname = where(i)
ElseIf i = 2 AND i < Ubound(where) AND IsNumeric(where) = False Then
streetname = where(i)
ElseIf i = 3 AND i < Ubound(where) AND IsNumeric(where) = False Then
streetname = where(i)
ElseIf i = 4 AND i < Ubound(where) AND IsNumeric(where) = False Then
streetname = where(i)
End If
If i = Ubound(where) AND IsNumeric(Left(where(i),1)) = True AND Len(where(i)) < 5 Then
If i = 1 Then
streetname = streetname&" "&where(i)
End If
If i = 2 Then
streetname = where(i-2)&" "&streetname&" "&where(i)
End If
If i = 3 Then
streetname = where(i-3)&" "&where(i-2)
End If
If i = 4 Then
streetname = where(i-4)&" "&where(i-3) & " " &where(i-2)
End If
If i = 5 Then
streetname = where(i-5)&" "&where(i-4) & " " &where(i-3) & " " & where(i-2)
End If
If i = 6 Then
streetname = where(i-6)&" "&where(i-5) & " " &where(i-4) & " " & where(i-3)
End If
Response.Write(i &" = " & streetname & "<br>")
End If
If i = Ubound(where) AND IsNumeric(Left(where(i),1)) = False Then
If i = 6 Then
streetname = where(i-6)&" "&where(i-5) & " " &where(i-4) & " " & where(i-3)
End If
If i = 5 Then
streetname = where(i-5)&" "&where(i-4) & " " &where(i-3) & " " & where(i-2)
End If
If i = 4 Then
streetname = where(i-4)&" "&where(i-3) & " " & where(i-2)
End If
If i = 3 Then
streetname = where(i-3)&" "&where(i-2)
End If
If i = 2 Then
streetname = streetname & " " &where(i)
End If
If i = 1 Then
streetname = streetname & " " &where(i)
End If
Response.Write(i &" = " & streetname & "<br>")
Response.Write(i &" = " & hybrid & "<br>")
End If
If i = Ubound(where) AND IsNumeric(Left(where(i),1)) = True AND Len(where(i)) = 5 Then
If i = 0 Then
zipcode = where(i)
End If
If i = 1 Then
streetname = where(i-1)
zipcode = where(i)
End If
If i = 2 Then
streetname = where(i-2) &" "& where(i-1)
zipcode = where(i)
End If
If i = 3 Then
streetname = where(i-3) &" "& where(i-2) &" "& where(i-1)
zipcode = where(i)
End If
If i = 4 Then
streetname = where(i-4) &" "& where(i-3) &" "& where(i-2) &" "& where(i-1)
zipcode = where(i)
End If
If i = 5 Then
streetname = where(i-5) &" "& where(i-4) &" "& where(i-2) &" "& where(i-1)
zipcode = where(i)
End If
Response.Write(i &" = " & streetname & "<br>")
Response.Write(i &" = " & zipcode & "<br>")
ElseIf i = Ubound(where) AND IsNumeric(Left(where(i),2)) = True AND Len(where(i)) = 2 Then
If i = 4 Then
streetname = where(i-4) &" "& where(i-3) &" "& where(i-2)
zipcode = where(i)
End If
If i = 3 Then
streetname = where(i-3) &" "& where(i-2)
zipcode = where(i-1)&where(i)
End If
If IsNumeric(Left(where(i-1),3)) = True AND Len(where(i-1)) = 3 Then
If i = 2 Then
streetname = where(i-2) '&" "& where(i-1)
zipcode = where(i-1)&where(i)
End If
End If
zipcode = where(i-1) & where(i)
Response.Write(i &" = " & zipcode & "<br>")
End If
Next
Response.Write("<br>")
Response.Write("streetname: " & streetname) & "<br>"
Response.Write("zipcode: " & zipcode) & "<br>"
Response.Write("hybrid: " & hybrid)
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
Similar Threads
- Replace a space with an underscore SOLVED (PHP)
- Limiting grep searches to a given file type? (Web Developers' Lounge)
- Desiging a set of rules for a match (C++)
Other Threads in the ASP Forum
- Previous Thread: creating download object.
- Next Thread: Updating table in a remote database



Linear Mode