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!

instring compare

Status
Not open for further replies.

PhatH

IS-IT--Management
Mar 30, 2004
88
US
Hello all,

I have varchar data ID (1, 2, 3, ...) that collected from checkboxes and saved into a Products table.

I'd like to use that data ID to get NAME(s)in a different PRODUCT TYPE table that have ID# matched.

I know INSTR can help but I need more instruction. Could someone be more specific how I can get the NAMEs.

Thanks!
 
This is what I got so far

<%
strProdTid = rs("ProdTypeID")
strProdTid = Trim(strProdTid)
arrID = Split(strProdTid, " ", -1, 1)
For Each strID in arrID
sql = "SELECT ProdTypeName FROM tblProductType WHERE ProdTypeID = " & strID
Set rs1 = objConn.Execute(sql)
%>
<td bgcolor="<% =bgcolor %>"><p><% =rs1("ProdTypeName") %></p></td>
<%
Next
%>

But there is an error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','.
/admin/products/Default.asp, line 37

any idea???
 
Thank you all, i got the problem solved now... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top