Connecting MS access with VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prabakar
    New Member
    • May 2007
    • 1

    Connecting MS access with VB

    How to connect MS access with VB
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by prabakar
    How to connect MS access with VB
    Hello, prabakar!

    You will need to do some reading:-)

    Let me fetch the link.

    Dököll

    Comment

    • Dököll
      Recognized Expert Top Contributor
      • Nov 2006
      • 2379

      #3
      Originally posted by prabakar
      How to connect MS access with VB
      Here you go:



      Let me know how it turns out...

      Comment

      • rave3085
        New Member
        • Apr 2007
        • 27

        #4
        well the code below gives a connection to the database

        dim db as new ADODB.connectio n

        set db =new ADODB.connectio n

        db.open="PROVID ER=Microsoft.je t.OLeDB.3.51;Da ta Source=" & App.Path & "\xxx.mdb;" this is for an access database, pls give your tablename in the xxx
        this makes a coinnection, however u need a Recordset to actually add,delete or edit records

        for this
        dim rs as new ADODB.recordset
        set rs =new ADODB.recordset
        rs.Open "SELECT * from tablename", db, adOpenDynamic, adLockOptimisti c


        this makes a perfect connection and now with a more detailed program u can add and delete records.

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Actually this is regarding the previous post

          First of all select Microsoft ADO Object library.from Project---Reference

          Next(regaring previous post)

          In place of xxx instead of using tablename please use DATABASE name.

          rest all is fine

          and to open the recordset use TABLENAME in the SQL statment.

          Comment

          • rave3085
            New Member
            • Apr 2007
            • 27

            #6
            hmm he was correct! sorry for the mistake! Do as he said!
            thats it

            Comment

            Working...