Results 1 to 6 of 6

Thread: .Net connecting to a MS MDB File ? (Sorted)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97

    .Net connecting to a MS MDB File ? (Sorted)

    Whats the best way in .Net to connect to an Access database ?
    Last edited by OptimusPrime; Jan 10th, 2003 at 04:47 AM.

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    It is through the OleDbConnection object.

    Then you have 2 possibilities, either ADO in connected mode or ADO in disconnected MODE.

    Connected mode uses a Command with a DataReader to read through the data in a fashion a lot like old ADO in vb6.

    Disconnected mode fills a Dataset with information from a DataAdapter. You then can use the data in a disconnected fashion, ie add, remove, update rows as you like without roundabouts to the database. You later use the Update method of the DataAdapter to push all you updates made to the Dataset through.

    There's alot more to this of course, but hopefully I got you on track...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97
    is it the same way i'd connect to a SQL Server Db ??

    caus im usin ado @ the mo but my boss wanted me to check out MDB's ?? god knows why SQL server's much better

  4. #4
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    There is a SQLConnection object a SQLDataAdapter and so on.... and they are much the same.

    So if you use that its just to change into OleDb version of all objects and change the connectionstring to a JET one.

    If that is the case I personally think SQL is better in most cases, but if you are using old ADO through com, I can only suggest that you change to either, as the difference between old ADO and ADO.NET is a lot greater that the difference between ADO.NET's SQL and OleDb variants.

  5. #5
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Thumbs up

    This might prove helpful. ConnectionStrings.com
    ~Peter


  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97
    many thanks think i've got it sorted

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