Hello guys
can anyone give me simple program on macro i write a below code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.Access.Dao;
namespace WindowsFormsApplication2
{ public partial class Form1 : Form
{public Form1()
{InitializeComponent();}
private void button1_Click(object sender, EventArgs e)
{Microsoft.Office.Interop.Access.Application acApp = new Microsoft.Office.Interop.Access.Application();
try{acApp.OpenCurrentDatabase(@"C:\Users\Administrator\Desktop\test.mdb",true);
object oMissing = System.Reflection.Missing.Value;
acApp.Run("Macro1", ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing
, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing
, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing
, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing
, ref oMissing, ref oMissing);}
catch
{}
finally
{acApp.Quit();
but it gives me an error that you cannot find the macro can you give me solution or code for that i use the access database or can you give me example code for using ms-access for C# .NET