| | |
Active X with C# error "ActiveX cannot create an object"
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2009
Posts: 17
Reputation:
Solved Threads: 0
Hi there,
I am using third party ActiveX control in my application. It requires RecordSet as a input parameter to its method. I am programming my application in C#. When I call the method after creating RecordSet it throws an exception "ActiveX cannot create an object". What is the potential cause?
My code is as bellow:
I am using third party ActiveX control in my application. It requires RecordSet as a input parameter to its method. I am programming my application in C#. When I call the method after creating RecordSet it throws an exception "ActiveX cannot create an object". What is the potential cause?
My code is as bellow:
C# Syntax (Toggle Plain Text)
// third party ActiveX object. DCSOCS.OCScallClass ocsCall = new DCSOCS.OCScallClass(); ADODB.Recordset recordSet = new ADODB.RecordsetClass(); string result = ""; recordSet.Fields._Append("MIMSHOST", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("MIMSPORT", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("MIMSUSER", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("MIMSPASSWORD", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("MIMSDISTRICT", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("MIMSPOSITION", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("WorkGroup", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("EmployeeID", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("NewActivityID", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("FromActivityDate", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("ToActivityDate", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Fields._Append("ChangeActInd", DataTypeEnum.adVarChar, 50, FieldAttributeEnum.adFldFixed); recordSet.Open(System.Reflection.Missing.Value, System.Reflection.Missing.Value, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockOptimistic, -1); recordSet.AddNew(System.Reflection.Missing.Value, System.Reflection.Missing.Value); recordSet.Fields[0].Value = server; recordSet.Fields[1].Value = port; recordSet.Fields[2].Value = user; recordSet.Fields[3].Value = password; recordSet.Fields[4].Value = district; recordSet.Fields[5].Value = null; recordSet.Fields[6].Value =employee.Workgroup; recordSet.Fields[7].Value = leave.EmployeeID; recordSet.Fields[8].Value = reason.Code; recordSet.Fields[9].Value = leave.Start.ToString(Constants.EllipseDate); recordSet.Fields[10].Value = leave.End.ToString(Constants.EllipseDate); recordSet.Fields[11].Value = "A"; try { result = ocsCall.UpdateRoster(ref recordSet); //recordSet.Close(); } catch (Exception ex) { DCS.OCS.Common.Error.Log("Ellipse", ex.ToString()); //recordSet.Close(); return "Ellipse Error"; } return result;
Check 3rd party control documentation!
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Jan 2009
Posts: 17
Reputation:
Solved Threads: 0
There is minimul documentation from 3rd party and that just suggest use adVarchar as input parameters of fields with width of 50. and takes in RecordSet as referenced input parameter.
Is there a way to debug DLL ? To at least know what is causing problem inside 3rd party DLL. I tried looking at Exception and try to access root cause but nothing coming out of it.
Is there a way to debug DLL ? To at least know what is causing problem inside 3rd party DLL. I tried looking at Exception and try to access root cause but nothing coming out of it.
Can you send me the documentation, or try to register the ocx again.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- more "home search assistent" fun... (Viruses, Spyware and other Nasties)
Other Threads in the C# Forum
- Previous Thread: display a charactar in x,y coordinate
- Next Thread: checkboxes in datagridview(windows application)
Views: 710 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code color control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gcd gdi+ http httpwebrequest image index input java list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving server sleep socket sql statistics stream string table textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






