Results 1 to 7 of 7

Thread: How to connect to an Access 2007 database?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Question How to connect to an Access 2007 database?

    Hello,

    I have decided to make a little "safebox", to store some important information. For some reason I have decided to use a database (even though I have never used it!), so I would like if someone could help me connect to the database.

    I'm not asking for the code (I won't complain if you post it ), but a couple of advices on how to do this or maybe links will be HIGHLY APPRECIATED!

    Thanks in advance!

    For some reason, I think I'm connected to the database... Here's a screen capture:

    Am I connected?

    Am I?
    Last edited by tassa; Aug 21st, 2009 at 12:11 AM.
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: How to connect to an Access 2007 database?

    Go to the Database Development forum and read the FAQ thread at the top and follow the .NET links from there. There's a tutorial from mendhak and code examples from myself so you shouldn't need much more than that for a while at least.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: How to connect to an Access 2007 database?

    What's the difference about doing what wrote on his post and creating a datasource via the designer?
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: How to connect to an Access 2007 database?

    Creating a Data Source generates a typed DataSet. This means that you can do things like this:
    vb.net Code:
    1. Dim firstName As String = myDataSet.Person(0).FirstName
    instead of this:
    vb.net Code:
    1. Dim firstName As String = myDataSet.Tables("Person")(0)("FirstName")
    It also means that the system will generate the SQL code and wrap in TableAdapters for you instead of your having to create the connections and data adapters yourself.

    It also means that you can drag tables and/or columns from the Data Sources window onto your form to automatically create controls and the associated components. For instance, if you drag a table from the Data Sources window it will automatically generate a DataGridView, BindingSource, BindingNavigator, DataSet and TableAdapter as well as the data-bindings and some skeleton code.

    The Data Source wizard does a lot of work for you and makes the rest of your work easier. Some people don't like that responsibility being taken out of their hands though.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: How to connect to an Access 2007 database?

    Wow. Umm, ok. So, should I use the wizard? (For learning purposes).
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: How to connect to an Access 2007 database?

    Quote Originally Posted by tassa View Post
    Wow. Umm, ok. So, should I use the wizard? (For learning purposes).
    That depends on what you want to learn. If you want to learn how to create an application that makes use of data then you should, because it means you can concentrate on that without worrying too much about how you get and save the data. If you want to learn the ins and outs of how you get and save data though, then maybe you shouldn't.

    Ideally we would use the tools that can make our life easier when they can do what we want but we would also understand what it is that these tools are doing for us. You have to know what a DataAdapter is and how it works to truly understand how a TableAdapter works, but if all you care about is the data that the TableAdapter will get and save then knowing how a DataAdapter works is no real help. It's up to you how deep you go and when.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: How to connect to an Access 2007 database?

    Well, I guess I'll give it another try tomorrow. Thanks for the input .
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

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