Spudhead
08-22-2006, 12:56 PM
set oDB = new databaseInterface
aStoryInfo = oDB.QuerySQL("SELECT [id], [title], [bodycopy], [image], [summary], [author] FROM [" & tblStories & "] WHERE [id]=" & iStoryID)
set oDB = nothing
if isArray(aStoryInfo) then
sStoryTitle = safeUnescape(aStoryInfo(1,0))
sBodyCopy = safeUnescape(aStoryInfo(2,0))
sImageURL = aStoryInfo(3,0)
sSummary = safeUnescape(aStoryInfo(4,0))
sAuthor = safeUnescape(aStoryInfo(5,0))
debug "*" & sBodyCopy & "*"
end if
ok so I'm using a functions library, most of which is irrelevant. databaseInterface is just a bunch of functions for connecting to the database and stuff, aStoryInfo is populated with a data array that's a result of an ADODB.Recordset "getRows()" method. safeUnescape and debug are pretty straightforward but for reference they are:
function debug(s)
response.write(s & "<br/>" & vbCrLf)
response.end
end function
function safeUnescape(str)
dim rv : rv = ""
if str & "" <> "" then rv = unescape(str)
safeUnescape = rv
end function
So: my problem. Is weird. Two of those data variables (sImageURL and sBodyCopy ) don't get populated.
I've run the generated SQL direct against the database (in Query Analyser) and I KNOW there's data in those fields. One big chunk of text, and one image filename. The database fields themselves are nothing special; a text(16) and an nvarchar(150).
I'm at a complete loss. Either you get a row full of data back or you don't. You never get a little bit. There are no errors, nothing else weird. I just don't get two fields.
aStoryInfo = oDB.QuerySQL("SELECT [id], [title], [bodycopy], [image], [summary], [author] FROM [" & tblStories & "] WHERE [id]=" & iStoryID)
set oDB = nothing
if isArray(aStoryInfo) then
sStoryTitle = safeUnescape(aStoryInfo(1,0))
sBodyCopy = safeUnescape(aStoryInfo(2,0))
sImageURL = aStoryInfo(3,0)
sSummary = safeUnescape(aStoryInfo(4,0))
sAuthor = safeUnescape(aStoryInfo(5,0))
debug "*" & sBodyCopy & "*"
end if
ok so I'm using a functions library, most of which is irrelevant. databaseInterface is just a bunch of functions for connecting to the database and stuff, aStoryInfo is populated with a data array that's a result of an ADODB.Recordset "getRows()" method. safeUnescape and debug are pretty straightforward but for reference they are:
function debug(s)
response.write(s & "<br/>" & vbCrLf)
response.end
end function
function safeUnescape(str)
dim rv : rv = ""
if str & "" <> "" then rv = unescape(str)
safeUnescape = rv
end function
So: my problem. Is weird. Two of those data variables (sImageURL and sBodyCopy ) don't get populated.
I've run the generated SQL direct against the database (in Query Analyser) and I KNOW there's data in those fields. One big chunk of text, and one image filename. The database fields themselves are nothing special; a text(16) and an nvarchar(150).
I'm at a complete loss. Either you get a row full of data back or you don't. You never get a little bit. There are no errors, nothing else weird. I just don't get two fields.