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. Listing the tables of MS Access (Error is This)

Listing the tables of MS Access (Error is This)

Scheduled Pinned Locked Moved C#
help
2 Posts 2 Posters 1 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.
  • D Offline
    D Offline
    Daminda
    wrote on last edited by
    #1

    :(( OleDbConnection conn = new OleDbConnection(string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Mode=ReadWrite",txtDbPath.Text)); OleDbCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT Name FROM MSysObjects WHERE Type = 1"; OleDbDataReader reader = null; try { conn.Open(); reader = cmd.ExecuteReader(); while (reader.Read()) { Console.WriteLine(reader.GetString(0)); lstTables.Items.Add (reader.GetName(0).ToString()); } } catch (Exception ex) { // Providing something like this in your ...(continued) Console.Error.WriteLine("An error occured: {0}", ex.Message); MessageBox.Show(ex.Message.ToString()); } finally { if (reader != null) reader.Close(); conn.Close(); } Error is An error occured: Record(s) cannot be read; no read permission on 'MSysObjects'.

    K 1 Reply Last reply
    0
    • D Daminda

      :(( OleDbConnection conn = new OleDbConnection(string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Mode=ReadWrite",txtDbPath.Text)); OleDbCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT Name FROM MSysObjects WHERE Type = 1"; OleDbDataReader reader = null; try { conn.Open(); reader = cmd.ExecuteReader(); while (reader.Read()) { Console.WriteLine(reader.GetString(0)); lstTables.Items.Add (reader.GetName(0).ToString()); } } catch (Exception ex) { // Providing something like this in your ...(continued) Console.Error.WriteLine("An error occured: {0}", ex.Message); MessageBox.Show(ex.Message.ToString()); } finally { if (reader != null) reader.Close(); conn.Close(); } Error is An error occured: Record(s) cannot be read; no read permission on 'MSysObjects'.

      K Offline
      K Offline
      krisp
      wrote on last edited by
      #2

      try: Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=Admin;Password= or maybe with double quotes on the password, but i dont think you need them, just let it end at the = Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=Admin;Password="" or with all default options: Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=Admin;Password="";Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False

      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