Include MDB file in Solution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian

    Include MDB file in Solution

    Hi, i include an Access Db in the solution of my project; now how can
    i connect to DB?
  • zacks@construction-imaging.com

    #2
    Re: Include MDB file in Solution

    On Apr 23, 9:30 am, Christian <christian.per. ..@gmail.comwro te:
    Hi, i include an Access Db in the solution of my project; now how can
    i connect to DB?
    You don't need to include the MDB in your solution to be able to
    access it.

    You need to make use of several class objects in the System.Data.ODB C
    namespace.

    ODBCConnection to connect.

    ODBCCommand to access data.

    ODBCDataReader to retrieve the data.

    Comment

    • Christian

      #3
      Re: Include MDB file in Solution

      On 23 Apr, 15:41, za...@construct ion-imaging.com wrote:
      On Apr 23, 9:30 am, Christian <christian.per. ..@gmail.comwro te:
      >
      Hi, i include an Access Db in the solution of my project; now how can
      i connect to DB?
      >
      You don't need to include the MDB in your solution to be able to
      access it.
      >
      You need to make use of several class objects in the System.Data.ODB C
      namespace.
      >
      ODBCConnection to connect.
      >
      ODBCCommand to access data.
      >
      ODBCDataReader to retrieve the data.


      ah ok!
      but what is the different between include MDB and not include(for
      example store it in c:\)?

      Comment

      • zacks@construction-imaging.com

        #4
        Re: Include MDB file in Solution

        On Apr 23, 9:45 am, Christian <christian.per. ..@gmail.comwro te:
        On 23 Apr, 15:41, za...@construct ion-imaging.com wrote:
        >
        >
        >
        >
        >
        On Apr 23, 9:30 am, Christian <christian.per. ..@gmail.comwro te:
        >
        Hi, i include an Access Db in the solution of my project; now how can
        i connect to DB?
        >
        You don't need to include the MDB in your solution to be able to
        access it.
        >
        You need to make use of several class objects in the System.Data.ODB C
        namespace.
        >
        ODBCConnection to connect.
        >
        ODBCCommand to access data.
        >
        ODBCDataReader to retrieve the data.
        >
        ah ok!
        but what is the different between include MDB and not include(for
        example store it in c:\)?
        There is no real reason, as far as I am aware, to include an MDB with
        the VS solution, other than maybe distributing it with the app.

        The connection string used by the ODBCConnection object includes a
        full path to the MDB file, so it can essentially be anywhere you want
        it to be.

        Comment

        • Ignacio Machin ( .NET/ C# MVP )

          #5
          Re: Include MDB file in Solution

          On Apr 23, 9:30 am, Christian <christian.per. ..@gmail.comwro te:
          Hi, i include an Access Db in the solution of my project; now how can
          i connect to DB?
          All you need to know is where you placed it. After that you access it
          the same way you do in your program.

          Comment

          • Ignacio Machin ( .NET/ C# MVP )

            #6
            Re: Include MDB file in Solution

            On Apr 23, 9:41 am, za...@construct ion-imaging.com wrote:
            On Apr 23, 9:30 am, Christian <christian.per. ..@gmail.comwro te:
            >
            Hi, i include an Access Db in the solution of my project; now how can
            i connect to DB?
            >
            You don't need to include the MDB in your solution to be able to
            access it.
            Yes you do, otherwise the application will not have a DB to connect
            to :)
            You need to make use of several class objects in the System.Data.ODB C
            namespace.
            Mdb is access, IIRC you can use OleDb provider with it

            Comment

            Working...