Select Statement help w ContentId??

Discussion in 'C#' started by danjapro, Jul 23, 2009.

  1. #1
    I have this Select statment, but I need to add into the Where section the ContentIs that is specific to recorded set.
    What I have below seem to not works please help:

    I only want the refcord I am calling from the DB as the content ID.

    <%
    'DIM mySQL
    'mySQL = "SELECT * FROM Content ORDER BY DateAdded DESC" 
    mySQL1 = "SELECT ContentID, ContentType, RelatedURL, DownloadURL, Thumbnail, FeaturedLabel, ShortDesc, LongDesc, Title AS Title " & _ 
    	"FROM (Content LEFT JOIN ContentTypes ON Content.ContentTypeId = ContentTypes.ContentTypeId) " & _ 
    	"WHERE ContentTypes.ContentTypeId = 7 and Content.ContentId = "' &strContentId& ' " Order by Priority"
    
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open mySQL1, objConn
    %>
    
    <%
    'DIM iRecordCount
    iRecordCount = 2
    
    'DO WHILE NOT objRS.EOF and iRecordCount <> 1
    
    %>
    
    
    <embed src='<% =objRS("RelatedURL") %>&hl=en&fs=1&' width='340' height='260' type='application/x-shockwave-flash' wmode='transparent' allowscriptaccess="always" allowfullscreen="false"/></embed>
    
    
     <%
    'iRecordCount = iRecordCount + 0
    'objRS.MoveNext
    'Loop
    
    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    %>
    Code (markup):
     
    danjapro, Jul 23, 2009 IP