Results 1 to 6 of 6

Thread: using ado.net with access

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    36

    using ado.net with access

    i am having problems in using ado.net with my access db. I have an example using a mysql server but i cant find any information regarding ado.net with access. can anybody help with a tutorial or sample code on just how to setup connection and execute sql statement on the db

    thanks

  2. #2
    Addicted Member
    Join Date
    Apr 2002
    Location
    California
    Posts
    160
    Sample Form and database attached. Make sure you set the "strDataBasePath" string at the top to the path of your database ie. "C:\Products.mdb"
    Attached Files Attached Files
    Jason Moore

    Software Engineer, Database Architect, Web Designer

    (C#,VB/NET,ASP/NET,COLDFUSION,JAVASCRIPT,SQL)

    http://www.gatorstudios.com
    [email protected]

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    36
    thanks for the reply, one question. how do i actually run the code to see it in operation??? the run button is disabled. do i need to call it from somewhere else???

    thanks again

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    36
    i am getting the following error
    An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

    this refers to the following line of code
    OleDbCommand1.Connection.Open()


    any ideas?

  5. #5
    Addicted Member
    Join Date
    Apr 2002
    Location
    California
    Posts
    160
    Yes, Make sure you set the "strDataBasePath" string at the top to the path of your database ie. "C:\Products.mdb"
    Jason Moore

    Software Engineer, Database Architect, Web Designer

    (C#,VB/NET,ASP/NET,COLDFUSION,JAVASCRIPT,SQL)

    http://www.gatorstudios.com
    [email protected]

  6. #6
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi Jason,

    Could you tell me why you use

    " Me.OleDbConnection1 = New system.Data.OleDb.OleDbConnection()"?

    I thought the following would suffice;

    Me.OleDbConnection1 = New OleDb.OleDbConnection()

    Many thanks
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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