Results 1 to 4 of 4

Thread: Access from VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    9

    Access from VB6

    Hi,

    Am new to databases. Have looked at many tutorials and can't seem to get my answer!

    Basically, when the program opens up, the user types in their name via input box, their details are then read from a Access database and then get put into text boxes.

    For example, if they input "Bill", the database is read, and then "Gates" gets put into txtSurname.

    Hope you can help.

    Thank you

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Access from VB6

    Take a look at the "Classic VB: ADO" section of our Database Development FAQs/Tutorials (at the top of this forum)

    What you want is covered by the "ADO Tutorial" and the "Further Steps" article (for the searching functionality). You will need to re-arrange the parts slightly to use the inputbox, but the information you need is there.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    9

    Re: Access from VB6

    Code:
    Private cn As ADODB.Connection  'this is the connection object
    Private rs As ADODB.Recordset   'this is the recordset object
    Code:
    Compile Error:
    
    User-defined type not defined

    Any ideas?

    Thanks

  4. #4
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    313

    Re: Access from VB6

    Looks like you didn't read the ADO TUTORIAL provided to you by Si.

    Add a reference to "Microsoft ActiveX Data Objects 2.x Library". Goto to Project menu then select the References sub-menu.
    It's right there,just look it over..
    http://www.vbforums.com/showthread.php?t=551154

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