Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. OLEDB Provider

OLEDB Provider

Scheduled Pinned Locked Moved Visual Basic
tutorial
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ivo75
    wrote on last edited by
    #1

    how to detect installed oledb provider in my PC. Jet 4.0 or ACE 12

    D 1 Reply Last reply
    0
    • I ivo75

      how to detect installed oledb provider in my PC. Jet 4.0 or ACE 12

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Try to connect to a database with one. If it fails, try the other.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      L I 2 Replies Last reply
      0
      • D Dave Kreskowiak

        Try to connect to a database with one. If it fails, try the other.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        My idea exactly, but then I didn't want to reply that, as it sounds a bit like "I really don't know"... :laugh:

        Luc Pattyn [My Articles] Nil Volentibus Arduum

        D 1 Reply Last reply
        0
        • L Luc Pattyn

          My idea exactly, but then I didn't want to reply that, as it sounds a bit like "I really don't know"... :laugh:

          Luc Pattyn [My Articles] Nil Volentibus Arduum

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Really, it's the only reliable way to do it. Actually, I'd try using ACE.12 first, then downgrade to 4.0. You could start check the version of Office that's installed, but then some application could have installed one of the Access Runtimes and making the detection code inaccurate.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Really, it's the only reliable way to do it. Actually, I'd try using ACE.12 first, then downgrade to 4.0. You could start check the version of Office that's installed, but then some application could have installed one of the Access Runtimes and making the detection code inaccurate.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            I fully agree; even if I knew a way to determine something like that, I'd probably go for the functional test anyway. With external dependencies involved, I prefer to eat the pudding, rather than to look for the boxes. :)

            Luc Pattyn [My Articles] Nil Volentibus Arduum

            D 1 Reply Last reply
            0
            • L Luc Pattyn

              I fully agree; even if I knew a way to determine something like that, I'd probably go for the functional test anyway. With external dependencies involved, I prefer to eat the pudding, rather than to look for the boxes. :)

              Luc Pattyn [My Articles] Nil Volentibus Arduum

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Luc Pattyn wrote:

              I prefer to eat the pudding, rather than to look for the boxes.

              :laugh: I haven't heard that one before. That's a good one.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              1 Reply Last reply
              0
              • D Dave Kreskowiak

                Try to connect to a database with one. If it fails, try the other.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                I Offline
                I Offline
                ivo75
                wrote on last edited by
                #7

                what You mean? This

                Public Sub ConnectToAccess()
                Dim conn As New System.Data.OleDb.OleDbConnection()
                conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & databasePath.dbPath & ";Persist Security Info=False;"

                    Try
                   conn.Open()
                   .......
                Catch ex As Exception
                   conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & databasePath.dbPath & ";User ID=Admin;Password="
                conn.Open()
                

                ........
                Finally
                conn.Close()
                End Try
                End Sub

                D 1 Reply Last reply
                0
                • I ivo75

                  what You mean? This

                  Public Sub ConnectToAccess()
                  Dim conn As New System.Data.OleDb.OleDbConnection()
                  conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & databasePath.dbPath & ";Persist Security Info=False;"

                      Try
                     conn.Open()
                     .......
                  Catch ex As Exception
                     conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & databasePath.dbPath & ";User ID=Admin;Password="
                  conn.Open()
                  

                  ........
                  Finally
                  conn.Close()
                  End Try
                  End Sub

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Kind of. I really wouldn't do it this way, but whatever works for you.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  I 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Kind of. I really wouldn't do it this way, but whatever works for you.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak

                    I Offline
                    I Offline
                    ivo75
                    wrote on last edited by
                    #9

                    give me some example how to do this

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups