scrivi così

codice:
<%
Dim count
set Gallery = Server.CreateObject("ADODB.Recordset")
sql = "select * from Gallery"
Gallery.ActiveConnection = cn
Gallery.Open sql, cn
count = 1
%>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%Do while not Gallery.EOF%>
	<%response.Write(gallery("IDGallery"))%>
	<% if count = 1 then %>
		<tr>
	<%end if%>
	
	<td align="center">
	<%if isNull (Gallery("immagine")) or (Gallery("immagine")) = "" then%>
		<%if isNull (Gallery("video2")) or (Gallery("video2")) = "" then%>
			<%response.Write("video no link")%>
		[img]gallery/ico_video.jpg[/img]
<font class="nero2"><%=Gallery("descrizione")%></font>
		<%else%>
			<%response.Write("video link")%>
			">[img]gallery/ico_video.jpg[/img]
<font class="nero2"><%=Gallery("descrizione")%></font>
		<%end if%>
	<%else%>
		<%if isNull (Gallery("immagine2")) or (Gallery("immagine2")) = "" then%>
			<%response.Write("immagine no link")%>
			[img]gallery/<%=Gallery([/img]" border="0">
<font class="nero2"><%=Gallery("descrizione")%></font>
		<%else%>
			<%response.Write("immagine link")%>
			')">[img]gallery/<%=Gallery([/img]" border="0">
<font class="nero2"><%=Gallery("descrizione")%></font>
		<%end if%>
	<%end if%>
	</td>
	<%if count = 3 then%>
		</tr>
		<%count = 0%>
	<%end if%>
	<%
	count = count + 1
	Gallery.movenext
loop
%>

</table>