I want to display my results in a table

Results 1 to 2 of 2

Thread: I want to display my results in a table

  1. #1
    Join Date
    Dec 1969

    Default I want to display my results in a table

    I am using the following script to do my search. But I want the results to appear in a table. How can I achieve this ? Or can someone show me an alternative method.<BR><BR>&#060;%@ Language = VBSCRIPT %&#062;<BR>&#060;% Option Explicit %&#062;<BR>&#060;%<BR> Dim iStart, iOffset<BR> iStart = Request("Start")<BR> iOffset = Request("Offset")<BR><BR> if Not IsNumeric(iStart) or Len(iStart) = 0 then<BR> iStart = 0<BR> else<BR> iStart = CInt(iStart)<BR> end if<BR><BR> if Not IsNumeric(iOffset) or Len(iOffset) = 0 then<BR> iOffset = 10<BR> else<BR> iOffset = Cint(iOffset)<BR> end if<BR><BR> Response.Write "Viewing " & iOffset & " records starting at record " & iStart & "<BR>"<BR><BR> Dim objConn, objRS<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "DSN=MP3"<BR><BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> objRS.Open "SELECT * FROM Mp3List", objConn<BR><BR> Dim aResults<BR> aResults = objRS.GetRows<BR><BR> objRS.Close<BR> Set objRS = Nothing<BR><BR> objConn.Close<BR> Set objConn = Nothing<BR><BR><BR> Dim iRows, iCols, iRowLoop, iColLoop, iStop<BR> iRows = UBound(aResults, 2)<BR> iCols = UBound(aResults, 1)<BR><BR> If iRows &#062; (iOffset + iStart) Then<BR> iStop = iOffset + iStart - 1<BR> Else<BR> iStop = iRows<BR> End If<BR><BR> For iRowLoop = iStart to iStop<BR> For iColLoop = 0 to iCols<BR> Response.Write aResults(iColLoop, iRowLoop) & " "<BR> Next<BR> Response.Write "<BR>"<BR> Next <BR><BR> Response.Write "&#060;P&#062;"<BR> if iStart &#062; 0 then<BR> &#039Show Prev link<BR> Response.Write "&#060;A HREF=""GetRows.asp?Start=" & iStart-iOffset & _<BR> "&Offset=" & iOffset & """&#062;Previous " & iOffset & "&#060;/A&#062;"<BR> end if<BR><BR> if iStop &#060; iRows then<BR> &#039Show Next link<BR> Response.Write " &#060;A HREF=""GetRows.asp?Start=" & iStart+iOffset & _<BR> "&Offset=" & iOffset & """&#062;Next " & iOffset & "&#060;/A&#062;"<BR> end if<BR>%&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default www.learnasp.com and the database lessons...

    I&#039m sure you&#039ll find several ways to do what you want at that site.<BR><BR>But it would help *you* learn if you would first figure out how to create a table (with dummy contents, perhaps) "by hand" in a simple HTML page (no ASP). Once you understand the basics of tables (and tables *can* get quite complex, but the basics are really easy) then adding a table to ASP code is a piece of cake.<BR><BR>Need some places to go for HTML help? Try these:<BR><BR>http://www.hwg.org/resources/faqs/<BR>http://www.cc.ukans.edu/~acs/docs/other/HTML_quick.shtml<BR>http://developer.netscape.com/docs/manuals/htmlguid/index.htm<BR><BR>Yeah, I know that last one is Netscape. But their docs are a lot better organized and a lot easier to read than the MS ones.<BR><BR>

Posting Permissions

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