travisbrown
Technical User
- Dec 31, 2001
- 1,016
Why would I be getting a type mismatch on Folio = rs.GetRows() in the first example? I regularly set the function name as the result array when creating recordsets from a database, like in the second example. Why is this any different?
Code:
SET fs = CreateObject("Scripting.FileSystemObject")
SET folder = fs.GetFolder(folio_path)
SET fc = folder.files
DIM rs
SET rs = createobject("adodb.recordset")
WITH rs.Fields
.Append "file_name", adChar, 255
END WITH
rs.Open
FOR EACH file in fc
rs.AddNew
rs("file_name") = file.name
rs.Update
NEXT
IF NOT rs.BOF AND NOT rs.EOF THEN
Folio = rs.GetRows()
END IF
rs.close
SET rs = Nothing
Code:
MyRecordset(input)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = dbconn
rs.Source = input
rs.Open()
IF NOT rs.EOF AND NOT rs.BOF THEN
MyRecordset = rs.GetRows()
END IF
rs.Close()
Set rs = Nothing