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

    Access a Microsoft Access database

    Hi,
    I am trying to connect to an Access database using ADO in visual basic. Can anyone help me with this. I don't know how to compose the connection string.


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Access a Microsoft Access database


    'add and Ado control to your form,
    'right click on it, select properties, and
    'let it help you in building the connection
    'string. then remove it from your
    'form and from loaded components if
    'you do noyt want to use.
    Dim strConnect as string
    Dim strconnectPwd as string
    'without password
    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Programmi\Microsoft Visual Studio\VB98\Biblio.mdb;Persist Security Info=false"
    'with password remembered
    strconnectPwd = "Provider=Microsoft.Jet.OLEDB.4.0;Password=donald;Data Source=C:\Programmi\Microsoft Visual Studio\VB98\Biblio.mdb;Persist Security Info=true"




    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood,
    Bruno Paris and all the other wonderful people who made and make Codeguru
    a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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