Ik dacht even handig te zijn door gebruik te maken van Server.Execute ipv het gebruik maken van een include. Het scheelt me erg veel code want ipv van een steeds groter wordende Select Case Page is ern u alleen de volgende regel nodig: Server.Execute "inc/"+Page+".inc"
Alleen nu slik krijg ik dus een error op het volgende stukje code uit een bestand dat ge-execute wordt.: adoRs.CursorLocation = adUseClient Bij het gebruik van inlude werkt het dus wel gewoon
De error bij gebruik van Server.Execute:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/beta/inc/home.inc, line 25
Alleen nu slik krijg ik dus een error op het volgende stukje code uit een bestand dat ge-execute wordt.: adoRs.CursorLocation = adUseClient Bij het gebruik van inlude werkt het dus wel gewoon
De error bij gebruik van Server.Execute:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/beta/inc/home.inc, line 25
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
| <div class="page">HOME</div>
<div class="text">
<%
Dim adoConn
Dim adoRs
Dim database
Dim Index
Dim strSQL
Dim offset
Dim prev
Dim numRecs
Dim totalRecs
database = Server.Mappath("db/content.mdb")
offset = Request.QueryString("offset")
numRecs = 5
strSQL = "SELECT Topic,Content,Posted FROM tblContent ORDER BY Posted DESC"
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & database
Set adoRs = Server.CreateObject("ADODB.Recordset")
adoRs.CursorLocation = adUseClient
adoRs.Open strSQL, adoConn,,adLockReadOnly, adCmdText
totalRecs = adoRs.RecordCount
'Response.Write totalRecs
adoRs.absolutePosition = 1
If offset > 1 Then
adoRs.absolutePosition = offset+1
End If
prev = offset-numRecs
'Response.Write "prev = " &prev& "<br />"
offset = offset+numRecs
%>
<table class="browse"><tr>
<td>
<%
If prev >= 0 Then
%>
<a href="./?offset=<%=prev%>">previous</a>
<%
Else
Response.Write "previous"
End If
%>
</td>
<td>
<%
If offset < totalRecs Then
%>
<a href="./?offset=<%=offset%>">next</a>
<%
Else
Response.Write "next"
End If
%>
</td>
</tr>
</table>
<div>
<%
'loop throug database
Dim y
FOR y=1 to numRecs
'WHILE NOT adoRs.EOF
%>
<div class="topic"><%=adoRs("topic")%> | <%=adoRs("posted")%></div>
<div class="content"><%=adoRs("Content")%></div>
<%
adoRs.Movenext
'WEND
If adoRs.EOF Then Exit For
next
adoRs.Close
adoConn.Close
%>
</div>
</div> |