Need to view my rs

Results 1 to 2 of 2

Thread: Need to view my rs

  1. #1
    Join Date
    Dec 1969

    Default Need to view my rs

    Hi Guys and Girls i am new to asp and quite keen to learn some hot stuff but i cant seem to figure out the error from my code as a result i have changed it quite a bit and am scared i cant get back to were i can recognise it. heres my code:<BR><BR>&#060;%@LANGUAGE="VBSCRIPT"%&#062;<BR >&#060;!--#include file="Connections/Music.asp" --&#062;<BR>&#060;%<BR>&#039; ***Declare variables<BR>Dim Conn<BR>Dim rsTitle<BR>Dim ConnStr<BR><BR>&#039;***Connectionstring<BR>ConnSt r = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:InetpubwwwrootTrialsMusic.mdb;Persist Security Info=False"<BR><BR>&#039;***Make connection with the database<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en ConnStr<BR>%&#062;<BR>&#060;%<BR>set rsTitle = Server.CreateObject("ADODB.Recordset")<BR>rsTitle. ActiveConnection = MM_Music_STRING<BR>rsTitle.Source = "SELECT * FROM Catalog"<BR>rsTitle.CursorType = 0<BR>rsTitle.CursorLocation = 2<BR>rsTitle.LockType = 3<BR>rsTitle.Open()<BR>rsTitle_numRows = 0<BR><BR>Response.Write Conn("Title")<BR><BR>%&#062;<BR><BR><BR>&#060;%<BR >&#039;***Close recordset and connection<BR><BR>rsTitle.Close<BR>Conn.Close<BR>S et rsTitle = Nothing<BR>Set Conn = Nothing<BR>%&#062;<BR><BR>very basic stuff but i cant get it to list my result set, i was able to get it to print the first entry on my rs but once i changed the code , i lost everything. the book is not much help

  2. #2
    Join Date
    Dec 1969

    Default RE: Need to view my rs

    if your query is returning more than one value then u should write:<BR><BR>while not rsTitle.eof<BR> response.write rsTitle("Title")<BR> rsTitle.Movenext<BR>wend<BR><BR>Hope that helps!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts