Hi, I have this code and it works fine. I want to only display 10 results out of my database of 1000. I have tried adding the limit 10; code but get a syntax error.
Where CategoryID=" & 60 & " limit 10;"
I tried adding rs.PageSize = 10, but that was no good either.
<%
'Create an ADO connection object
Set adoCon = Server.CreateOb ject("ADODB.Con nection")
' Database connection
Set con = CreateObject("A DODB.Connection ")
con.Provider = "Microsoft.Jet. OLEDB.4.0"
con.Open Server.MapPath( "database/greeting.mdb")
'Create an ADO recordset object
Set rs = Server.CreateOb ject("ADODB.Rec ordset")
sql = "Select author,uk,cardd escription FROM tblGreetingPost Cards Where CategoryID=" & 60 & ""
'Open the recordset with the SQL query
rs.Open SQL, Con
'Loop through the recordset
Do While not rs.EOF
'Write the HTML to display the current record in the recordset
Response.Write " <b><ul><li><spa n><a class=""mena"" title=""" & rs("carddescrip tion") & """ href=""day.asp? uk=" & rs("uk") & """>" & rs("carddescrip tion") & "</a></span></li></ul></b>"
rs.MoveNext
Loop
'Reset server objects
rs.Close
Set rs = Nothing
Set Con = Nothing
%>
</li>
Any help would be appreciated. I am sure its a small thing but cannot fathom it out.
Thanks in advance
Richard
Where CategoryID=" & 60 & " limit 10;"
I tried adding rs.PageSize = 10, but that was no good either.
<%
'Create an ADO connection object
Set adoCon = Server.CreateOb ject("ADODB.Con nection")
' Database connection
Set con = CreateObject("A DODB.Connection ")
con.Provider = "Microsoft.Jet. OLEDB.4.0"
con.Open Server.MapPath( "database/greeting.mdb")
'Create an ADO recordset object
Set rs = Server.CreateOb ject("ADODB.Rec ordset")
sql = "Select author,uk,cardd escription FROM tblGreetingPost Cards Where CategoryID=" & 60 & ""
'Open the recordset with the SQL query
rs.Open SQL, Con
'Loop through the recordset
Do While not rs.EOF
'Write the HTML to display the current record in the recordset
Response.Write " <b><ul><li><spa n><a class=""mena"" title=""" & rs("carddescrip tion") & """ href=""day.asp? uk=" & rs("uk") & """>" & rs("carddescrip tion") & "</a></span></li></ul></b>"
rs.MoveNext
Loop
'Reset server objects
rs.Close
Set rs = Nothing
Set Con = Nothing
%>
</li>
Any help would be appreciated. I am sure its a small thing but cannot fathom it out.
Thanks in advance
Richard
Comment