Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.

Thanks,
-- John
 
¤ 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/d...l/vbtskCreatingConnectionToAccessDatabase.asp


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Thanks Paul. I suppose I should have spent a while more navigating through
MSDN. Regardless, that's what I needed.

Thanks again,
-- John
 
Back
Top