Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - DISPLAY RECORDS HORIZONTALLY
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DISPLAY RECORDS HORIZONTALLY

 Post Reply Post Reply
Author
BlueMask View Drop Down
Newbie
Newbie
Avatar

Joined: 27 April 2003
Location: Turkey
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote BlueMask Quote  Post ReplyReply Direct Link To This Post Topic: DISPLAY RECORDS HORIZONTALLY
    Posted: 20 September 2005 at 11:00am
Pls help me, i want to show my images horizally. 3 by 3, but my code doesn't work.
 
Like as :
 
image1   image2   image3
 
image4   image5   image6
 
.......
 

<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("mydb.mdb") & ";"
objConn.Open
 
DIM mySQL, objRS
mySQL = "SELECT * FROM TblVeri"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn
DIM recCount
IF Not objRS.EOF THEN
Response.Write "<table width='100%'>"
recCount = 0
Do UNTIL objRS.EOF
IF recCount Mod 3 = 0 THEN
IF recCount <> 0 THEN
Response.Write "</tr>"
Response.Write "<tr><td>"&objRS("AD")&"</td>"
ELSE
Response.Write "<td>"&objRS("AD")&"</td>"
END IF
recCount = recCount + 1
objRS.MoveNext
Loop
Response.Write"</tr></table>"
ELSE
Response.Write "Sorry, there are no records in our database."
END IF
%>
 


Edited by BlueMask - 20 September 2005 at 11:01am
Back to Top
padoxky View Drop Down
Groupie
Groupie
Avatar

Joined: 17 June 2004
Location: Nigeria
Status: Offline
Points: 78
Post Options Post Options   Thanks (0) Thanks(0)   Quote padoxky Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2005 at 10:53am

I had used these method before. Try it should work. Is ODBC connection.

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' HTTP="false"
' Catalog=""
' Schema=""

Set objConn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("mydb.mdb")


set objRS = Server.CreateObject("ADODB.Recordset")
objRS.ActiveConnection = objConn
objRS.Source = "SELECT * TblVeri"
objRS.CursorType = 0
objRS.CursorLocation = 2
objRS.LockType = 3
objRS.Open()
objRS_numRows = 0
%>

<%
Dim HLooper1__numRows
HLooper1__numRows = -2
Dim HLooper1__index
HLooper1__index = 0
objRS_numRows =objRS_numRows + HLooper1__numRows
%>

<head>

</head>

<div>
  <table border="0" cellspacing="2" cellpadding="2" width="100%">
   
    <tr>
      <td align="center" valign="middle"> <table width="98%" cellpadding="2" cellspacing="2">
          <%
startrw = 0
endrw = HLooper1__index
numberColumns = 3  'Set numbers columns you want
numrows = -1
while((numrows <> 0) AND (Not objRS.EOF))
 startrw = endrw + 1
 endrw = endrw + numberColumns
 %>
          <tr align="center" valign="top">
            <%
While ((startrw <= endrw) AND (Not objRS.EOF))
%>
            <td> <table width="100%" border="0" cellspacing="2" cellpadding="2">
                <tr align="left" valign="middle">
                & ;nbs p; <td width="22"></td>
                & ;nbs p; <td><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><%=(objRS.Fields.Item("IMAGE_NAME").Value)%></a></font></td>
                </tr>
                <tr align="left" valign="middle">
                & ;nbs p; <td>&nbsp;</td>
                & ;nbs p; <td><i><%=(objRS.Fields.Item("IMAGE_DESCRIPTION").Value)%></i></td>
                </tr>
              </table></td>
            <%
 startrw = startrw + 1
 objRS.MoveNext()
 Wend
 %>
          </tr>
          <%
 numrows=numrows-1
 Wend
 %>
        </table></td>
    </tr>
    <tr>
      <td align="center" valign="middle" class="text"></td>
    </tr>
  </table>
</div>
<%
objRS.Close()
%>



Edited by padoxky - 23 September 2005 at 11:05am
NgWebDesigns
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.