Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Connecting to Access databases (XP Pro)

    I have been trying to write VB.Net code in web forms to interact with an Access database, e.g. insert operation from text box control, and have been unable to get it to work. Getting data out is a lot simpler. Has anyone some basic code that will help me out? I have been trying to set up a new application where data can be entered by a user and then stored in a database.

    Graeme

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Access databases (XP Pro)

    Hi Graeme,

    The quickest example I could find is from Microsoft's MSDN site: ADO.NET Primer.

    This looks like a great article that will apply to almost any .NET environment or language. Unfortunately, the examples are all in C# rather than VB. There are quite a few links below the article that can lead you into other directions. (By the way, you'll have to use the DataAdapter object to write data.)

    Hope this helps!

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Access databases (XP Pro)

    I think you have a standard ADO.Net problem, rather than anything to do with JET.

    In Visual Studio.Net, add a new form to your project, using the "data form wizard". Select a DSN to your access data file, and make sure you go for fields not a datagrid. The wizard will generate sample code for you to pick apart.
    (If you do this from a VB profect, you get VB code, from a C# project you get C# code.)

    The issue, for the uninitiated, is that you have to save the changes from the form to the dataset, and then commit the altered dataset back to teh datasource. By default, you spend a lot of time committing the unchanged dataset...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •