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

SQL dynamic meta tags not being displayed

Status
Not open for further replies.

campdw

Technical User
Mar 15, 2005
4
GB
Hello

I am trying to display dynamic meta tags throughout my website but I am unable to get the data to display anything. Can someone take a look at my SQL statement?

##########################################################
<%
Dim rsMetaKeywords__varCatCode
rsMetaKeywords__varCatCode = ""
If (sCc <> "") Then
rsMetaKeywords__varCatCode = sCc
End If
%>
<%
Dim rsMetaKeywords
Dim rsMetaKeywords_numRows

Set rsMetaKeywords = Server.CreateObject("ADODB.Recordset")
rsMetaKeywords.ActiveConnection = MM_dtor_data_STRING
rsMetaKeywords.Source = "SELECT CATEGORY, CUSTMEMO1 FROM dbo.CATEGORY WHERE CATEGORY = '" + Replace(rsMetaKeywords__varCatCode, "'", "''") + "' ORDER BY CATEGORY"
rsMetaKeywords.CursorType = 0
rsMetaKeywords.CursorLocation = 2
rsMetaKeywords.LockType = 1
rsMetaKeywords.Open()

rsMetaKeywords_numRows = 0
%>
<meta name="keywords" content="<%=(rsMetaKeywords.Fields.Item("CUSTMEMO1").Value)%>">
<meta name="description" content="<%=rsMetaKeywords__varCatCode%>">
<%
rsMetaKeywords.Close()
Set rsMetaKeywords = Nothing
%>
##########################################################

When the script runs the variable rsMetaKeywords__varCatCode is assigned a value of the category code but I think the problem lies with the rsMetaKeywords.Source part of the script.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top