Posted 4 August 2017, 3:22 pm ESTHi all,
I'm trying to create a custom ADO recordset in memory, I already have a recordset pulled from a DB which is working correctly.
For this second recordset (in memory) I'm not entirely sure if I have the syntax quite right. What I have so far is below, with a little bit of script for testing.
I'm getting an error on line 17 (CustomRS.Fields.Append "name", adinteger) which is below as well. I've tried this line with and without setting the field type and length.
I'm fairly new to VB script but any help would be great.
ERROR: Line number: 17 Description:Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
SCRIPT SO FAR:
Set Connection = CreateObject("ADODB.connection")
Set RS = CreateObject("ADODB.Recordset")
Connection.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=C:\Program Files\Insite\Cranstar\Server Shares\Insite Data\site1park.mdb; persist security Info=False"
RS.open "SELECT * FROM Booking_header", Connection
Set CustomRS =CreateObject("ADODB.Recordset")
CustomRS.Fields.Append "name", adinteger
CustomRS("name") = 123
rpt.sections("Pageheader").controls("CustomRS").datavalue = CustomRS("name")
rpt.sections("detail").controls("DC").recordset = RS