CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Posts
    58

    create recordset on the fly

    anyone know how to create recordset on the fly using ADO?? please enclose the code is possible.. thanks in advance...... good days and cheers!!!


  2. #2
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: create recordset on the fly

    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 :-)

  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: create recordset on the fly

    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
    ...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured