Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace function in asp/vbscript

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
here's some code. After reading some of the other postings, I think I understand it. I'm just looking for some clarification from someone who knows better than I:

sRegion = Replace(Session("Region"), "'", "''")
sBranch = Replace(Session("Branch"), "'", "''")
sBuilding = Replace(Session("Building"), "'", "''")
sStreetAddress = Replace(Session("StreetAddress"), "'", "''")

What I think this is doing is a check on the session variables called Region, Branch, Building, and Street Address. If there are any single apostrophes in the aforementioned variables (which incidentally are pulled from a database), then this code replaces them with an extra ' in order to prevent errors. Am I accurate?

thanks. How much water would there be in the ocean if it weren't for sponges?
 
The "errors" I think only occur in data base operations using that data in an SQL statement with a clause like WHERE followed by data conatining a sigle quote. If it is in data itself it should not cause a problem or be "doubled".
 
thank you! How much water would there be in the ocean if it weren't for sponges?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top