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

display record using checkbox

Status
Not open for further replies.

oops4me

Programmer
Jul 7, 2003
50
IN
hello, i want to write a code in asp which displays records of submitted values by html page(using multiple checkbox selection).i am collecting all checkbox values in one variable.i have written following code but it is giving me error at line where i have given sql query. just see my which i have written as below

<!-- #include file="adovbs.inc"-->
<%
strIDs=request.form("chk1")
set con = Server.CreateObject("ADODB.Connection")
mydb = Server.MapPath("db/trycera.mdb")
con.mode=adModeReadWrite
con.connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& mydb &";Persist Security Info=False"
con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& mydb &";Persist Security Info=False"
set rs=con.execute("select * FROM ulogin WHERE username IN " &"(" & strIDs & ")" )
rs.close
rs.locktype = adlockoptimistic
rs.cursortype = adopendynamic
rs.cursorlocation = aduseclient
rs.open
while not rs.eof
response.write (rs.fields("username"))
response.write(rs.field("verification"))
response.write(rs.fields("productid"))
rs.movenext
wend

%>
just see the code & tell me the changes.in this strIDs is contains usernames (in format like aaa,bbb,ccc). i have to show records of these users.

please tell me the code
 
thank u for ur help,but can u tell me how to do that.
because i have tried in may ways.

the contents in strIDs are aaa,bbb,ccc.i want to make it
'aaa','bbb','ccc'. so the query will work.can u tell me how to do that. i want to implement this code in my programm.
 
You might try using the Replace function. Something like:
NewString = "'" & Replace(OldString , "," , "','") & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top