anyone know how to create recordset on the fly using ADO?? please enclose the code is possible.. thanks in advance...... good days and cheers!!!
Printable View
anyone know how to create recordset on the fly using ADO?? please enclose the code is possible.. thanks in advance...... good days and cheers!!!
Add a reference to MS ActiveX Data Objects library, and in code you can declare something like
Dim db as ADODB.Recordset
set db = new ADODB.Recordset
db.Open "SELECT myfield FROM mytable WHERE myfield = somevalue" ' Your query here
do while not db.EOF
' do the things you want with the data
loop
db.Close
set db = nothing
Is this what you meant?
Crazy D @ Work :-)
do you mean something like this
dim r as ador.recordset
set r = new ador.recordset
r.fields.append "fieldname", adInteger
r.open
r.addnew
r.fields(0).value = 5
...