retrieve from SQL Server Using ASP

currently, i created a page for user to select a alphabet (A-Z), then i want to get all the members name which start with the key-in aplhabet
i'd tried using SQL command to retrieve it,but nothing came out
tempalpha = request.form("alpha")
sSQL = "Select * From IMAGE1 where emp_id like '"
sSQL = sSQL & tempalpha% & "'"
is that correct...after it couldn't worked i try this
i changed tempalpha% to tempalpha_...
but the same result came out,
pls help me
Who is Participating?
siabodConnect With a Mentor Commented:
The percentage should be within the string, is the value tempalph a variable ? then the string should be :
sSQL = sSQL & tempalpha & "%'"

If tempalpha is the begining you'd like to search for physically then the string would be :
Select * From IMAGE1 where emp_id like 'tempalpha%'

but i guess seeing the name that it is a variable ;-)

Hope it helps you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.