Underlig Array Fejl
jeg har følgende kode:<%
' -----------------------------------
' Dim Section (DONT CHANGE!)
' -----------------------------------
Dim arrPageSubject, arrPageDescription, arrPageText
Dim arrPageImage, arrPageAuthor, arrPageId
Dim arrPageDate, Separator, strPageDate
Dim strPageSubject, strPageDescription, strPageText
Dim strPageImage, strPageAuthor, strPageId
' -----------------------------------
' -----------------------------------
' -----------------------------------
' FRONTPAGE FUNCTION
' -----------------------------------
Function Frontpage()
If Request.Querystring("Page") = "" Then
Conn()
strFrontpage = "SELECT * FROM pages WHERE page_type = 'News' ORDER BY page_id DESC"
set rs = Conn.Execute(strFrontpage)
Separator = ""
While Not rs.EOF
strPageSubject = strPageSubject & Separator & rs("page_subject")
strPageDescription = strPageDescription & Separator & rs("page_description")
strPageText = strPageText & Separator & rs("page_text")
strPageImage = strPageImage & Separator & rs("page_image")
strPageAuthor = strPageAuthor & Separator & rs("page_author")
strPageId = strPageId & Separator & rs("page_id")
strPageDate = strPageDate & Separator & rs("page_date")
Separator = "|"
rs.MoveNext
Wend
arrPageSubject = Split(strPageSubject,"|")
arrPageDescription = Split(strPageDescription,"|")
arrPageText = Split(strPageText,"|")
arrPageImage = Split(arrPageImage,"|")
arrPageAuthor = Split(arrPageAuthor,"|")
arrPageId = Split(arrPageId,"|")
arrPageDate = Split(arrPageDate,"|")
End If
End Function
' -----------------------------------
' -----------------------------------
%>
Til at udskrive de forskellige databaseudtræk har jeg For eks. koden:
<!--#include file="inc_engine.asp"-->
<%
Frontpage()
Response.Write arrPageText(1)
%>
Mit problem er, at arrPageText, arrPageSubject og arrPageDescription virker som de skal. De arrays der kommer efterfølgende genererer out of bounds fejl, hvilket jeg intet forstår af.
Nogen idéer?
Mvh.