|
terryhutt1959@hotmail.com wrote:
I destroyed the COM+ package and registered the dll with regsvr32. All is now working.
I just love users who can figure out problems themselves.
Thanks for the comment, by the way.
My articles and software tools
|
|
|
|
|
Hi.
I need some help with my connection string. Im trying to connect to a password protected MS Access database. This is my connection string:
"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin; Password=whatever;Data Source=E:\\BN\\test\\ht.mdb;"
When I use this connection string I get the following error:
"System.Data.OleDb.OleDbException: Cannot start your application. The workgroup information file is missing or opened exclusively by another user. at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at webchange.attachme.InsertRow(String myConnectionString, String myInsertQuery) at webchange.attachme.Upload_ServerClick(Object sender, EventArgs e)"
The thing is... when i remove the password in the database and use this connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\BN\\test\\ht.mdb;" .... it works fine. I've allready tried all the workarounds i've found on Microsofts pages (http://support.microsoft.com/default.aspx?scid=kb;en-us;316675) but i allways get the same error...
Any ideas?
tnx in advance
-dodge
|
|
|
|
|
Here is the solution to the problem you have, it took me a while to figure it out.
In your connection string, you need to change the Password string to Jet OLEDB:Database Password, like the following:
<br />
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Jet OLEDB:Database Password=123456;Data Source=E:\\BN\\test\\ht.mdb<br />
It worked for me.
My articles and software tools
|
|
|
|
|
Tnx alot! Works fine. It might have taken you a while to figure out, but it sure would have taken me forever
|
|
|
|
|
To use your class ,how can I receive the events fired by COM
|
|
|
|
|
chaocai wrote:
To use your class ,how can I receive the events fired by COM
To receive com event, you need to set up the event sink and connect it to the outgoing event interface in the com object.
If you are developing a GUI application (MFC or VB), then using com and receiving com event is easy, you don't need to use my class at all.
If you are familiar with ATL or want to learn it, you don't need to use my class either.
To use the XYDispDriver class to handle com event, you need to implement the event interface in another com object, please read Handling COM Events in a Console Application for more details. This is definitely not the easiest way for beginners.
Good luck.
My articles and software tools
|
|
|
|
|
I have try what you said,but it did not run.
I think your GetObject method must invoke the CreateInstanceEx not the CreateInstance.
MSDN say CreateInstance can only create a local instance of the class.
I do not know much about how to use the CreateInstanceEx.How to change your program?
Thank a lots
|
|
|
|
|
Thanks for your comment and suggestion.
Yes, you are right. I have modified the class XYDispDriver to create com object on remote machines. My article and code will be updated. You can down load the new files at the link below.
The CreateObject method has been updated to include a new parameter strServerName. To create a com object on a remote server, you need to do the following:
1. Register and configure (using com+) the com object on the remote machine.
2. Export and import the com object (using com+) to the local machine.
3. Call the CreateObject method as follows:
XYDispDriver disp;
disp.CreateObject("MyProgId", CLSCTX_ALL, "MyServerName");
Good luck.
XYDispDriver.zip (7.2 Kb)
My articles and software tools
|
|
|
|
|
|
Just when you think the work is done ...
I introduced a new bug in the code. The following line in CreateObject
m_hRet = ::CoCreateInstanceEx(clsid,NULL,strServerName==NULL?dwClsContext:NULL,&svrinfo,1,&multiqi);
should be changed to
m_hRet = ::CoCreateInstanceEx(clsid,NULL,dwClsContext, strServerName==NULL?NULL amp;svrinfo),1,&multiqi);
Sorry for the inconvenience.
I will correct the problem as soon as possible.
My articles and software tools
|
|
|
|
|
Hi,
I have just read your article "A simple .NET TCL Socket Component" - XYNetSocket. I am relatively new to .NET programming, I just wondered why did you write some of this in C# and some in VB.NET? Is there a reason or is it just the way it happened....? I thought that all of the languages in .NET were variations around the same thing i.e. not one was better or worse to use than the other....?
Kind regards,
Dom
|
|
|
|
|
DJ_Catboy wrote:
I just wondered why did you write some of this in C# and some in VB.NET? Is there a reason or is it just the way it happened....?
It is just the way it happened, no special reason (there was a reason but it is no longer valid). Thanks for your interest.
My articles and software tools
|
|
|
|
|
How to change the programme to make it can create an instance of the class on remote machine.
thanks a lot
|
|
|
|
|
chaocai wrote:
How to change the programme to make it can create an instance of the class on remote machine.
I assume what you want to do is, use XYDispDriver to create com object remotely. You need to be familiar with COM+ (or DCOM) in order to do this.
1. First, the com dlll or exe you want to use has to be registered with COM+ as "server application" on the remote machine.
2. Secondly, you need to create a type library by exporting the server application from the remote machine. The type library should be imported on your local machine (where code using XYDispDriver runs).
3. Finally, call the CreateObject method of the XYDispDriver class. The com object created will live on the remote machine.
Note that you cannot do this for all com objects and it all depends on how your com component is constructed.
Good luck.
My articles and software tools
|
|
|
|
|
Attempted to run a vbscript using xyntservice and got the following error message:
Failed to start program 'vbcode3.vbs', error code = 2
When I code the ini file to look like the following:
[Settings]
ServiceName = XYNTService
proccount = 1
CheckProcess = 20
[Process0]
CommandLine = Wscript vbcode3.vbs
workingDir = c:\
userinterface = yes
Restart = no
The service starts the process "Wscript" but does not run the program associated with it. Any ideas on how to get the VBScript code to run?
Thanks
Al Olson
|
|
|
|
|
Ok, this is an easy one. The "error code = 2" means the system cannot find your file, in this case it is the vb script file that it can't find.
You need to change the command line in your XYNTService.ini file to something like the following:
CommandLine=wscript c:\mydir\vbcode3.vbs
Good luck.
My articles and software tools
|
|
|
|
|
Thanks for the suggestion, however this doesn't work either. When I try it WScript becomes a started process but it does not run the program VBCode3.vbs. I can see WScript in the process list but it is not getting any CPU time nor is the program accessing any of the data. My vbscript code is suppose to access the domain coontroller on the network and when I run this from the command line with the following command it works great:
Wscript VBCode3.vbs
Any thoughts?
Thanks
al
|
|
|
|
|
This time it might be a different problem. Please check the XYNTService.log file again, if it no longer generates the "Error code = 2" error, then the previous problem was fixed.
If the above is true, the new problem could be a "resource" issue. This is the most typical problem for an app to fail when started by a service. Basically, XYNTService is using the "Local System" account by default, it does not have access to many resources on the network, which may include the "domain controller". What you can do is reconfigure the service to run under your own account (or another domain account that has the appropriate rights). The reconfiguration process is already described in my article in detail (see the FAQ section).
Good luck.
My articles and software tools
|
|
|
|
|
I figured that it would need to be setup under my account so I did so based upon your directions. I just got done checking it and it turns out that the process did work, output files were created and they did contain the correct data. The surprising thing here is that when viewing the process "WScript" it does not appear to be getting cpu time at all, yet the process still worked. The only change I made in the ini file was to run my VBScript module in batch mode using "//B" parameter. This job does run a long time and it did take over 90 minutes to complete. I'll be letting this service run each time I log in now to see if it continues to operate as expected. Thank you for you help
al
|
|
|
|
|
Hi,
Thanks.I saw your sample XYEvent1.my doubt is say if i have created a ATL Control say a BUTTON.And included events for this .And In my VC++ console application i dynamiccaly create controls(more than 1 BUTTON).My doubt is How to know which button was clicked on the console
and fire the event.Pls help.I am struggling for a while with this.
I will be really grateful if u help me in this regard.Even if u take you sample how to handle this?
Thnks in advance
Ram
|
|
|
|
|
The method I use does not work with GUI controls (Buttons, Text Boxes, etc.). I used ATL in my projects, but I do not know enough to give you advice on how to handle com events with ATL. Sorry.
You can find a lot of references on COM EVENT and ATL from the web. For example, search "ATL COM Event" on google will give you a lot results.
Good luck.
Click here to see my articles and software tools
|
|
|
|
|
|
Hi,
I have a BIG question ... . How did you managed to write so many articles on codeproject.com? Do you have any full/part time job? I would also like to write more, but I have not time for , I have to work 8-10 hours/day. Hopfuly you can give me the clue ... THANKS.
|
|
|
|
|
Iulian Iuga wrote:
How did you managed to write so many articles on codeproject.com? Do you have any full/part time job?
Hi, Iulian. The answer to your question is, I don't waste time posting in the forums like others do. Seriously, there are people who have written more articles than me and still managed to make a lot of posts in various forums.
By the way, I do have a full-time job and I enjoy a lot of freedom in my work (most of times I can decide a lot of things myself).
Thank you for your interests.
Click here to see my articles and software tools
|
|
|
|
|
Good Luck!
You are the best!Me too!
|
|
|
|