Go to Google Groups Home    microsoft.public.dotnet.framework
Re: Access

Paul Clement <useadddressatendofmess...@swspectrum.com>

On Wed, 7 Dec 2005 11:57:02 -0800, "John Thompson" <JohnThomp...@discussions.microsoft.com> wrote:

¤ OK,
¤
¤ I have an access addin.  On startup, I can open my database and enumerate
¤ the tables in the database:
¤
¤ ...
¤ myApp = (Micorsoft.Office.Interop.Access.Application) application;
¤ myApp.OpenCurrentDatabase("c:\\mydatabase.mdb");
¤ foreach (Microsoft.Office.Interop.Access.AccessObject ao in
¤ myApp.CurrentData.AllTables)
¤ {
¤   System.Windows.Forms.MessageBox.Show(ao.Name.ToString());
¤ }
¤
¤ My question is, once I have the particular table that I want, how do I
¤ add/delete a record from it?  It seems like a pretty easy task, but I can't
¤ find an example anywhere or documentation anywhere.

Use ADO.NET with simple insert and delete SQL statements:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbco...

Paul
~~~~
Microsoft MVP (Visual Basic)