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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Accessing Access DataBase

Accessing Access DataBase

Scheduled Pinned Locked Moved C#
databasesql-serversysadmintutorialannouncement
3 Posts 3 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.
  • A Offline
    A Offline
    aPerfectCircle
    wrote on last edited by
    #1

    I'm tryin to find online a sample of a Windows code on how to access an Access DataBase,how to retreive and dispaly Data from different tables, and also how to update that database, all my online search hits were samples on Sql server . aPerfectTool

    K N 2 Replies Last reply
    0
    • A aPerfectCircle

      I'm tryin to find online a sample of a Windows code on how to access an Access DataBase,how to retreive and dispaly Data from different tables, and also how to update that database, all my online search hits were samples on Sql server . aPerfectTool

      K Offline
      K Offline
      Kodanda Pani
      wrote on last edited by
      #2

      Hi, Try using the following code. OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\Samples\Test.mdb; Mode=Share Deny None;Persist Security Info=False;Jet OLEDB:System database=C:\SYSTEM.MDW;"); conn.Open(); OleDbDataAdapter da = new OleDbDataAdapter(); OleDbCommand command = new OleDbCommand(); command.Connection = conn; command.CommandText = "select * from person" ; da.SelectCommand = command; DataSet ds = new DataSet(); da.Fill(ds); Thanks and Regards Pani

      1 Reply Last reply
      0
      • A aPerfectCircle

        I'm tryin to find online a sample of a Windows code on how to access an Access DataBase,how to retreive and dispaly Data from different tables, and also how to update that database, all my online search hits were samples on Sql server . aPerfectTool

        N Offline
        N Offline
        Navas M
        wrote on last edited by
        #3

        //insert the data into table using the access connection //that is table having the two field string name = t1.text; int regno = t2.text //stud is ur table name //ur declare this variable as varchar in ur table then using '"++"'between //the varible string query = "insert into stud values('"+name+"','"+regno+"'); OleDbConnection con = new OleDbConnection(@"Provider = Microsoft.Jet.OLEDB4.0; Password = ; User id=Admin;Data Source =d:\table\stud.mdb"); con.Open(); OleDbCommand cmd=new OleDbCommand(query,con); cmd.ExecuteNonQuery(); con.Close();

        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