I need to open MSAccess report from VS2010 C# using CREATEINSTANCE
The problem is in docmd.openreport method
Please help!!
Type objType = Type.GetTypeFromProgID("Access.Application");
object objAccess = Activator.CreateInstance(objType);
objType.InvokeMember("OpenCurrentDatabase", System.Reflection.BindingFlags.InvokeMethod, null, objAccess, new object[] { strPath });
Object objRptName = sReportName;
objType.InvokeMember("Run", System.Reflection.BindingFlags.InvokeMethod, null, objAccess, new object[] { "ReportTest", "Testing Parameter to be printed on report"});;
Need help here
objType.InvokeMember("OpenReport", System.Reflection.BindingFlags.InvokeMethod, null, objDoCmd, new object[] { 2, moMissing, moMissing })