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. C#
  4. Problem with Access database connectivity in C#.Net

Problem with Access database connectivity in C#.Net

Scheduled Pinned Locked Moved C#
helpcsharpdatabase
6 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.
  • V Offline
    V Offline
    Verghese
    wrote on last edited by
    #1

    I have declared a OLEDB connection string with the follwing details: myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); In the form_load, i have opend the connnection as( myCon.open();) but its showing this error : Error Message : An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll The same error is being displayed even with try catch................pls help me :confused: ..............thnx

    Subin Verghese Software Engineer

    G S 2 Replies Last reply
    0
    • V Verghese

      I have declared a OLEDB connection string with the follwing details: myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); In the form_load, i have opend the connnection as( myCon.open();) but its showing this error : Error Message : An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll The same error is being displayed even with try catch................pls help me :confused: ..............thnx

      Subin Verghese Software Engineer

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      Verghese, Try and below:

      myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;Data Source=empDB.mdb");

      OLE Db Exception[^] If that doesn't work, is there any text provided with the error?

      Regards, Gareth. (FKA gareth111)

      V 2 Replies Last reply
      0
      • V Verghese

        I have declared a OLEDB connection string with the follwing details: myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); In the form_load, i have opend the connnection as( myCon.open();) but its showing this error : Error Message : An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll The same error is being displayed even with try catch................pls help me :confused: ..............thnx

        Subin Verghese Software Engineer

        S Offline
        S Offline
        Sujith C Jose
        wrote on last edited by
        #3

        hi verghese, Try this 1. If you are using standard security Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;User Id=admin;Password=; 2. If you are using a password for your access file Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;Jet OLEDB:Database Password=MyDbPassword; ;) regards

        Sujith Blog 123

        V 1 Reply Last reply
        0
        • G Gareth H

          Verghese, Try and below:

          myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;Data Source=empDB.mdb");

          OLE Db Exception[^] If that doesn't work, is there any text provided with the error?

          Regards, Gareth. (FKA gareth111)

          V Offline
          V Offline
          Verghese
          wrote on last edited by
          #4

          Gareth, thnx for the reply but it isnt working still.......i have included the main codes below, just check thru......... using System.Data.OleDb; private OleDbConnection myCon; public Form1() { myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=empDB.mdb"); InitializeComponent(); } private void Form1_Load(object sender, System.EventArgs e) { myCon.Open(); MessageBox.Show("Successfully Connected"); } And this is the error message which I'm getting : "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"

          Thanks

          1 Reply Last reply
          0
          • S Sujith C Jose

            hi verghese, Try this 1. If you are using standard security Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;User Id=admin;Password=; 2. If you are using a password for your access file Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dbsample.mdb;Jet OLEDB:Database Password=MyDbPassword; ;) regards

            Sujith Blog 123

            V Offline
            V Offline
            Verghese
            wrote on last edited by
            #5

            Good job Sujith.........tht was the problm with the path.......i gave the full path and it worked........thanx a lot..........bye

            Thanks

            1 Reply Last reply
            0
            • G Gareth H

              Verghese, Try and below:

              myCon = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;Data Source=empDB.mdb");

              OLE Db Exception[^] If that doesn't work, is there any text provided with the error?

              Regards, Gareth. (FKA gareth111)

              V Offline
              V Offline
              Verghese
              wrote on last edited by
              #6

              Gareth, i got the solution.........i entered the full path and it worked.........and this is for ur info.......tek care.............happy coding............

              Thanks

              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