0
Answer

How to eun Microsoft Access method/function with parameters from C# app

Elmar

Elmar

12y
1.9k
1

this works fine -

Access.Application acApp = new Access.ApplicationClass();
acApp.OpenCurrentDatabase(@"C:\temp\db1.accdb",false ,null);
object oMissing = System.Reflection.Missing.Value;

acApp.Run("ABC",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);
acApp.Quit();

but I need to pass a few parameters to ABC

acApp.Run("ABC('par1', 'par2')", .... or acApp.Run("ABC 'par1', 'par2'", ..... generate error message "Could not find method  ABC('par1', 'par2')