how to connect my vb project to microsoft access 2003 database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • navda
    New Member
    • Jan 2010
    • 9

    how to connect my vb project to microsoft access 2003 database

    hi ...
    i want the solution for this question please help me out.
    i have created a database in microsoft access database 2003 .the name of my database is information and i have created a table name employee having field names (employee no,employee name,employee address,emplyee salary) and also records had been entered.
    so now i have designed an interface in visual basic with the same field names using labels and also provided textbox for the specified field names
    where i can get my output from the connected database .

    i have used data control and set its properties like
    connect=access
    databasename=C: \Program Files\Microsoft Visual Studio\VB98\inf ormation.mbd."
    but the last thing when i click the recordsource property it says "unrecogniz ed database format'C:\Progr am Files\Microsoft Visual Studio\VB98\inf ormation.mbd."

    and when i applied the same process for sample database provided with vb6 then the problem does not exist.

    whats the problem why i cant connect to the database i have created ???
    please help me
    looking forward at nvnrai8@gmail.c om
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    That is because MS changes the format of Access's *.mdb files every now and then (nearly every iteration of a new office version...).

    See http://www.connectionstrings.com to see the differences between the various versions of the connection strings needed for the various versions of access.

    Now, there are a couple of things that you can do to solve this...

    One is to use Access 2k3 and save the file in a prior access version. The other is to remove the data control and add the ADODC control while using the information from www.connectionstrings.com to be able to connect.

    And finally, just get rid of the control and use code to access the database...

    Now, if you don't know how to use code to access the database, then you will need to search for an ADO tutorial with your friends (yahoo, google, ask, answers, bing) or you could use the data form wizard to generate the code for you (found under add-ins>add-in manager). However, since the data form wizard was put out before the 2k3 format, you may have to use the ODBC option. If so, no big deal, use it (after creating one), and then use the information from www.connectionstrings.com...



    Good Luck

    Comment

    • navda
      New Member
      • Jan 2010
      • 9

      #3
      well thanks for answering me back
      but it didn't helped me a lot i just want to be clear that is it possible to connect my access database 2003 to vb project using data control .
      the other solution you provided me by using adodc control.well i can connect my same database using adodc earlier but i just want to connect through data control also . i can connect excel 2003 database using data control but why not access 2003 database.
      if its not possible than what's the code to connect related to data control.
      please help me out .........

      Comment

      • vb5prgrmr
        Recognized Expert Contributor
        • Oct 2009
        • 305

        #4
        Your answer lies at connectionstrin g.com if their is one since the Data1 control is DAO based (if I remember correclty) and since they updated DAO since the Data1 was released, you just may be out of luck...

        Do you have the option in the connect property to connect to an access 2003 database?



        Good Luck

        Comment

        Working...