CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2002
    Location
    Australia
    Posts
    6

    Question Database connectivity (MS_Access)

    I am relatively new to VB programming. Could anyone please help me in getting database connectivity in VB. I am actually using MS_Access as my database.

    And also could U please tell me how to replicate a form record(combination of controls) at run time.

    Thanks and Regards
    Ram

  2. #2
    Join Date
    Nov 2001
    Location
    Toronto, Canada
    Posts
    199
    first, you have to have a data environment.
    from menu: project ->data environment
    right click on connection and select property
    selsect ms jet 4.0 OLEDB provicer
    select your database
    click on test connection
    if you are connected, then you are connected to the database

    if you need to do any insert or quary at run time, let me know, i will send you some sample code.

    rgds,
    kethees

  3. #3
    Join Date
    Oct 2002
    Location
    India
    Posts
    103
    Hi

    try connecting with the OLEDB

    Dim dbconn as ADODB.Connection

    Set dbconn =new ADODB.Connection

    dbconn.open "Provider=Microsoft.jet.oledb.3.51/4.0;Data Source=" Path of your MDB File"


    Pls Tell me does this work
    Nilesh
    Pune, Maharashtra
    India

  4. #4
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923
    I suggest you use ADO (ADODB). This is a powerfull database collection of objects. Now, there is ADO.NET, but ADO is still a lot used in the industry, this is a sure value.

    Also, I suggest you find a book about ADO (ActiveX Data Objects) and Visual Basic. You will want to learn from the basis, and database programming might be hard. Also, you can use ADODC control to make a connection to a database. ADODC use ADO, and ADO use OLEDB, but anyway, find a book, there is some tutorials and example on the web, but nothing like a well written book. Search the forum for links, you may find interesting tutorials

    JeffB
    CodeGuru VB FAQ Visual Basic Frequently Asked Questions
    VB Code color Tool to color your VB code on CodeGuru
    Before you post Importants informations to know before posting

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