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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Function on Datasource

Status
Not open for further replies.

micawber

Programmer
Dec 10, 2002
71
GB
On my asp page I am using the replace function to remove spaces from a user input.
Does anyone know if i can do the same for my data source (excel spreadsheet) if so how?
Many thanks.
Below is the code for the section.

Code:
<%
dim output, number, strSQL, rs, mystring
output=request.form("input")
mystring = Replace(output, " ", "")
if mystring  <> "" then
strSQL="SELECT * FROM [sheet1$] WHERE phone1='"&mystring&"'"
   set rs=Server.CreateObject("ADODB.Recordset")
   rs.Open strSQL, conn, 3,3
%>
 
Clean up the spreadsheet in Excel so the page doesn't have to handle it.
 
In Excel, you can use the TRIM() function. Come to think of it, you can do the same in VBScript (which you are presumably using in your ASP files).

------------------------------------------------------------------------------------------------------------------------
"As for the bureacratic, politically-correct, mollycoddling, asinine, Romper Room antics of...clients and management, just read up on Dilbert. It's not funny - it's a training manual."
- Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top