Jeg har et problem med Mod operatoren. Jeg får følgende fejlkode:
ADODB.Connection error '800a0e78'
Operation is not allowed when the object is closed.
/test/webstore/menu_top1.asp, line 14
Her er koden:
<%
dim Antal
Set Conn = Server.Createobject("ADODB.Connection")
DSN ="Driver={Microsoft Access Driver(*.mdb)}; "
DSN = DSN & "DBQ=" & Server.mappath("skrive/menu.mdb")
Conn.Execute DSN
strSQL = "Select * From produkt"
Set rs = Conn.execute(strSQL)
Antal = 0
Response.Write "<Table><TR>"
Do
If 25 Mod 5 = 0 Then ***** LINIE 14 *****
Response.Write "</TR>"
If rs.EOF OR rs.BOF Then
Exit Do
ElseIf NOT rs.EOF or rs.BOF Then
Response.Write "<TR>"
End If
Response.Write "<TD>" & rs("produkt") & "</TD>"
Antal = Antal + 1
rs.MoveNext
ElseIf NOT Antal Mod 5 = 0 Then
If rs.EOF OR rs.BOF Then Exit Do
Response.Write "<TD>" & rs("produkt") & "</TD>"
Antal = Antal + 1
rs.MoveNext
End If
Loop
Do
If Antal Mod 5 = 0 Then
Exit Do
ElseIf NOT Antal Mod 5 = 0 Then
Response.Write "<TD></TD>"
End If
Loop
Response.Write "</Table>"
%>
--
Venlig Hilsen Henrik
http://www.geekcode.com
GIT/GMU$ d S: a--- C++ !U !P L !E W+++ N+ O-- K? w++++ O- M@
V? !PS !PE Y PGP t 5+ X++ R- tv+ b+ DI++ D+ G e- h! r++ y++