Hi!
I am new asp developer and want to set things in 3 column and display 4 rows in each column
How is the code ? Does code below need to add more ???
<%@ LANGUAGE = "VBScript"%>
<%
'open a database connection
Set dataconnection = Server.CreateObject("ADODB.Connection")
dataconnection.Open "DSN=yourDSNhere"
Response.Write "<html><body>"
'execute your select statement
query = "SELECT * FROM TABLE"
Set rs = dataconnection.Execute(query)
'If there are records in table
If Not rs.EOF Then
Response.Write"<table border=1>"
LinkCount = 0
' Do until the end of all records
Do Until rs.EOF
'change 5 to any number of columns you like
If LinkCount Mod 3 = 0 Then
If LinkCount <> 0 Then Response.Write"</tr>"
Response.Write"<tr><td>"&rs("NAME")&"<br>"&rs("DESCRIP")&"</td>"
Else
Response.Write"<td>"&rs("NAME")&"<br>"&rs("DESCRIP")&"</td>"
End If
LinkCount = LinkCount + 1
'loop till end of records
rs.MoveNext
Loop
Response.Write"</tr></table>"
'Close
rs.Close
Set rs = Nothing
Else
'Write no records in there are no records
Response.Write"Sorry, no records were found!"