Creating an ado recordset from an fso object

I have an fso object that gets all the files in a directory. I want to create a recordset by file name, size and date so that I can sort the recordset by date.

what i tried:

Dim rs set rs=Server.CreateObject("ADODB.recordset") -----------> rs.fields.append "Name", 201 rs.fields.append "Size", 201 rs.fields.append "Date", 7 RS.Open() fld1 = RS.Fields("Name") fld2 = RS.Fields("Size") fld3 = RS.Fields("Date") rs.close 

I get an error: arguments of the wrong type are out of range or are in conflict with each other with an arrow

NEVER MIND: error for reserved words

sulution must have a field name in "[" and "]"

+4
source share
1 answer

After .Open you must .Addnew to create a string to which you can assign your values.

Also I would use rs.fields.append "Size", 201, 255 (200 = advarchar; 255 = max len) instead of longvarchar 201, which iirc is implemented as blob, so it is not so strong.

+2
source

All Articles