Results 1 to 2 of 2

Thread: Database Input

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    207

    Cool

    Ok you all probably heard this qustion a million times before but I am a little confused so I am going to ask it anyways.

    The question is how do I get data out of a microsoft database?

    Ok I have a database called userinfo.mdb, a microsoft database (access 2000). It has a table called information and three text fields. The first is called first, the second is called last, and the third is called other.

    With that said my question is how do I access the nth data record into three string variables first, last, and other. There are two other sub questions, the first is how do I tell what data record I currently am looking at the the other is how do I tell what is the last data record.

    Any help in this matter would be greatly appreciated, oh ya I am currently using vb 5 but if that is a problem for this project then I can load 6.

    Thanks
    Jeremy

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    dim db as database
    dim rs as recordset

    set db = dbengine.opendatabase("dename.mdb")
    set rs = db.openrecordset("select * from tablename")

    do until rs.eof
    debug.print rs.fields("first"),rs.fields("last") etc
    loop


    create a refreence to DAO 3.1 by adding a data control object to your form and then deleting it.


    what you are looking at??

    rs.absoluteposition

    lastone
    rs.movelast
    rs.recordcount
    Kurt Simons
    [I know I'm a hack but my clients don't!]

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