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

Having problems with Move.Next, i need help!

Status
Not open for further replies.

airski

Programmer
Nov 25, 2002
8
US
Here is my code:

<%

Sub showKeywords(connobj)

Dim strHTML

Dim rs
Set rs = Server.CreateObject (&quot;ADODB.Recordset&quot;)
sql = &quot;Select keywords FROM products;&quot;
rs.Open sql, connobj, adOpenForwardOnly,adLockReadOnly,adCmdText

If not rs.EOF then
strHTML = &quot;<META NAME=&quot; & &quot;keywords content=&quot;
While Not rs.EOF
strHTML = strHTML & rs(&quot;keywords&quot;)
rs.MoveNext
Wend
strHTML = strHTML & &quot;>&quot;
Else
strHTML = &quot;No keywords found.&quot;
End if

rs.Close
Set rs = Nothing

Response.Write strHTML

End Sub
%>

All i am trying to do is take the keywords from my database and ad them to a meta tag. My database has 8 products and it takes the keywords from all eight products instid of the one displayed on the page? How do i make it only use keywords for certain products? Example: If you click on &quot;Car&quot; I want it to get the keywords from the record &quot;Car&quot;, field &quot;keywords&quot; and insert them in the meta tag for that page?

This one has me !!

Thanks,

AirSki
 
You have to use a Where clause to limit the records to only what you need.

sql = &quot;Select keywords FROM products Where RecordName = '&quot; & Identifier & &quot;';&quot;

Identifier could be Car, Truck, Airplane, Submarine, Space Shuttle and so on and should be passed somehow to your asp.

HTH
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top