"Kaven Tan" wrote in message
news:F2CAE485-4014-40C7-9A52-1007B51B290E@microsoft.com...
: I am having a problem removing the blank space that is generated by my
code as follows using ASP
:
:
: SELECT * FROM [USER_TABLE] WHERE [USER_ID]=' 0221 ' OR [USER_ID]=' ASDF '
:
: As you experienced chaps will know I should now get any blank space in
between = and 0221 or ASDF it should be
:
: SELECT * FROM [USER_TABLE] WHERE [USER_ID]='0221' OR [USER_ID]='ASDF'
:
: Snippet of code as follows:
:
: For i=1 to Delete_NO
: ourkey=trim("[USER_ID]="&chr(39))
: ourkey=trim(ourkey&trim(deletearray(i-1))&trim("'"))
:
: sqlkey=sqlkey & ourkey
: If i<Delete_NO then
: sqlkey=sqlkey & " OR "
: End if
: Next
:
: Dim strsql
: strsql="SELECT * FROM [USER_TABLE] WHERE " & sqlkey
: Response.Write strsql

What will this do?

For i = 1 to Delete_NO
sqlkey = sqlkey & "[USER_ID]='" & trim(deletearray(i-1)) & "'"
If i < Delete_NO then
sqlkey = sqlkey & " OR "
End if
Next

Dim strsql
strsql="SELECT * FROM [USER_TABLE] WHERE " & sqlkey
Response.Write strsql

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - [url]http://www.microsoft.com/technet/scriptcenter/[/url]
WSH 5.6 Documentation - [url]http://msdn.microsoft.com/downloads/list/webdev.asp[/url]
MSDN Library - [url]http://msdn.microsoft.com/library/default.asp[/url]