CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2006
    Posts
    18

    Talking How to insert, delete, update and display data with MS Access database

    Hello again guys,
    I have a problem with Access database, I have two database with 12 table. I have connected the database using Datasaurces Wizard in VB 2005 xpress edition. The problem is how I want to retrive the data using SQL Statement and along with that how I am going to insert, delete, update and display the data in the Textbox, Richtextbox and Datagrid. That all, TQ.

  2. #2
    Join Date
    Oct 2006
    Posts
    65

    Re: How to insert, delete, update and display data with MS Access database

    If u r using vb, use adodc component.
    u can add adodc component by pressing CTRL+T, add this component in form, right click and select properties. cnfigure ur db connection.
    finally add ur text box and configure their property according to ur db data but the source connection for these boxes should be adodc.

    umar

  3. #3
    Join Date
    Dec 2005
    Location
    Waterloo ON
    Posts
    545

    Re: How to insert, delete, update and display data with MS Access database

    Look up ADO.NET classes in namespace "System.Data.OleDb".

  4. #4
    Join Date
    Oct 2005
    Location
    Islamabad, Pakistan
    Posts
    1,277

    Re: How to insert, delete, update and display data with MS Access database


  5. #5
    Join Date
    Sep 2006
    Posts
    18

    Unhappy Re: How to insert, delete, update and display data with MS Access database

    Thank you for answering my questions but I am still confuse because all the sample coding is based upon SQL server rather than MS Access. Could you guys provide a coding in MS Access. Thank you.

  6. #6
    Join Date
    Dec 2005
    Location
    Waterloo ON
    Posts
    545

    Re: How to insert, delete, update and display data with MS Access database

    Sample code:
    Code:
    Public Shared Function getDataFromDB() As DataSet
    	Dim conn As New OleDb.OleDbConnection("connection string here")
    	Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM TableName;", conn)
    	Dim ds As New DataSet
    
    	da.Fill(ds)
    	Return ds
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured