Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 ActiveX DLL
Hi,
 
I am facing some problems in the deployment of my VB ActiveX DLL on a server.
I have a job which runs a stored procedure. The job and the SP are on the same server as the DLL. Using this stored procedure I access the classes (and the methods in those classes) in DLL by using the sp_oacreate and sp_oamethod.
 
The application, whose DLL is deployed, is on another server and is in VB6.0
Now I have modified a small code of this application and created another DLL.
I want to place my DLL there on the server by replacing the old one.
For this I unregistered the old DLL by using REGSVR32 /u and then registered my DLL there.
but I am not getting the result. Even though the code which I have modified gives results on the machine where the source code is present.
I ran the SQL Profiler and caught a query which was making an error entry in an error table.
 
The Error is:clsRoll.CheckSchedulesItem cannot be found in the collection corresponding to the requested name or ordinal.
 
the name of my DLL is GMSAutoRoll.dll
clsRoll is a class file and CheckSchedules is a method in the class and it's public.
 
Please Help!!!
It's really urgent....
Posted 12-Feb-13 1:04am
Comments
CHill60 at 12-Feb-13 9:02am
   
Any particular reason why you've installed the DLL on a different server to the application that uses it?
When you say you have registered the DLL ... on which server did you register it? It needs to be in the registry of the server that it is being *used* on ... i.e. the server with the application on, not the server on which it happens to reside
Adwaitam at 12-Feb-13 11:30am
   
thanks for the reply..by the way i have registered the dll on the registry of server where the application is. but still facing this issue...
CHill60 at 12-Feb-13 11:43am
   
Ok ... what I normally do in these circumstances is unregister and remove the new DLL then put the old DLL back (and reregister it). If it "works" - obviously not fully as your changes have been removed :-) then it could be to do with your changes ... possible a typo in a function/property name. Just trying to narrow down the field.
Sergey Alexandrovich Kryukov at 12-Feb-13 13:01pm
   
Any particular reason to use VB6? :-)
—SA
CHill60 at 12-Feb-13 18:22pm
   
I'm guessing the VB6 thing is because there are soooo many corporates out here still using legacy applications and only just realising that they need to move on. It's actually guite good for us dinosaurs that can still code in VB6 and have a bit of an idea of how to migrate to C# etc. :-) At the end of the day if you can't actually help the guy, and it's not a repost and it's not spam and it's not homework *what* was the point of your comment???
Sergey Alexandrovich Kryukov at 12-Feb-13 18:29pm
   
No point, just cannot help wondering, even understanding what you say... :-)
—SA
Sergey Alexandrovich Kryukov at 12-Feb-13 21:30pm
   
...but I don't want to frustrate you, so I though of some advice. With a sound point. Before the end of a day. :-)
—SA
Adwaitam at 13-Feb-13 3:34am
   
hey SA,
The existing application is in VB6 only and its huge one. So just solving the one or two issues rather suggesting complete migration. I know that VB6 sometimes make u work hard...but at this moment the point is in battling against VB6 only...:)
Sergey Alexandrovich Kryukov at 13-Feb-13 11:44am
   
I do understand it, and really sorry about your situation. Please see also my response comments to my answer...
—SA
Chris Reynolds (BNY) at 13-Feb-13 4:28am
   
When you call sp_OACreate do you pass a progid (such as "GMSAutoRoll.clsRoll") or a clsid (a GUID) as that will alter how COM chooses which DLL to service the request.
Adwaitam at 13-Feb-13 12:14pm
   
we are passing the progid like "GMSAutoRoll.clsRoll" as a parameter..but still having above mentioned issue

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is a solution more for CHill60 who I don't want to frustrate, rather than for OP, but I'm sure my answer will be pretty useful for nearly everyone, especially for those using VB6.
 
How to mount a dead horse?
 
Even though its seems that, if a horse is dead, using some other, more suitable horse would be the best strategy, a lot of people in such situation use alternative strategy for many years, when it comes to using some software products.
 
Here are those strategies used by people to mount a dead horse:
  1. To buy a bigger whip and whip harder.
  2. To hire an expert who can help in the dead horse study.
  3. To exchange opinions with other riders who had similar experience.
  4. To improve horse grooming.
  5. To take a training course "Mastering Horse in Ten Days".
  6. To convince yourself in the importance of mastering the horse in modern society.
  7. To convince yourself that a horse is not dead but is currently sleeping.
  8. To buy a book on horse speed optimization.
  9. If all of the above did not work: to declare that the dead horse is "more comfortable".
If someone thinks that this answer is less than perfect, I will gladly agree. It's just so happened that the I saw this anecdote at the moment when I still remembered this questions and comments. In fact, the analogy is pretty pure: in reality, we are discussing the horse which was born dead and people who failed to notice it.
 
[EDIT] See also: second comment to this question: Declarition Expected Errors[^] by Christian Graus.
 
Happy riding!
 
—SA
  Permalink  
v9
Comments
Chris Reynolds (BNY) at 13-Feb-13 4:32am
   
How does this diatribe meet "Let's work to help developers, not make them feel stupid.".
 
VB6 is still behind many core systems of large companies. Sure there are better choices now but redeveloping a large system isn't always an option.
Sergey Alexandrovich Kryukov at 13-Feb-13 11:30am
   
There is nothing about making people stupid here! This is maybe more important advice: do you guys really want to waste your life (I didn't even say "time", I say "life"!)? Think about it! Look around!
 
I really want to help people. I think helping to cope with VB6 can be the anti-help, the way to prolong waste of time. You might have different opinion, but I stand for mine.
 
—SA
Chris Reynolds (BNY) at 13-Feb-13 11:41am
   
You've chosen to vent your opinions on a programming language that the OP asserts it is beyond his remit to switch from.
To use your analogy. VB6 is an old horse that a lot of people have travelled many happy miles on and still works. COBOL is an old horse, PL1 is an old horse. Maybe you wouldn't buy those horses today but they aren't dead and have miles left in them.
As you requested, I've just looked around and seen a team of programmers who can code in a number of languages very well including VB6, C#, PL1 and others as occasion and requirement demands - they all seem happy enough.
Sergey Alexandrovich Kryukov at 13-Feb-13 11:43am
   
It does not prove anything. What I say also prove anything, but using it is just using the principle "let it be: I'll be in trouble, but not today". No more no less.
 
Thank you for sharing your thoughts.
—SA
Chris Reynolds (BNY) at 13-Feb-13 11:58am
   
And in that there is some truth. At some point all systems may need to be re-developed, an issue that is greater in the Windows world than, say, IBM mainframes where the tools to recompile COBOL etc from the 1970s still exist. In the Windows world we are dependent on tool vendors continuing to support old versions and Microsoft are not keen to maintain support for the VB6 development tools under new OSes even though the runtime persists. So, yes, companies with large suites of VB6 may need to re-develop due to platform incompatibilities. However this is not a fault of the language, just the choice of the vendor. Programmers do not always get the chance to choose when to redevelop a system although they can offer that opinion. In the mean time I don't see a problem helping other developers who have issues with any programming language.
Sergey Alexandrovich Kryukov at 13-Feb-13 13:34pm
   
It should be noted that it depends. First thing is to avoid is the though that newer things are better then older.
 
For example, creation of VB was just an offer of a tool for unprofessional users (as I sometimes say, created to distract the beginners from the opportunities of competing with Microsoft :-)), creation of VB6 was a tremendous regress compared t much, much older languages and development system. Commercial programming plays with dark motives of the users who are needed only to bring money, so such a bad thing (in not controlled) as vendor lock-in, personal imprinting and the like, supports the dead-end situation which is good for making money be those who introduced the technology.
 
In practice, the most important implication is this: it is absolutely important to be very well familiar with wide range of technologies and languages, wide spectrum of alternatives. Many think this is a waste of time, but in real life it's just the opposite. Another important thing is critical thinking about the trends. One of the sure ways to lead yourself nowhere is to do something which is "cool". :-)
 
Thank you,
—SA
Adwaitam at 13-Feb-13 15:29pm
   
hey SA...I guess we are distracting from the topic here...it will be great if you can suggest some tricks to solve this problem...I respect the way of thinking you have but this is not the issue at the moment.
Thanks.
Sergey Alexandrovich Kryukov at 13-Feb-13 15:48pm
   
Sorry, I don't think any tricks can be useful...
—SA
Chris Reynolds (BNY) at 14-Feb-13 4:13am
   
Yes, back on topic. I guess we need to work through eliminating some things. That error makes it look like the method isn't present in the DLL but we could do with checking we're running the right DLL.
Have you stopped and started the SQL Server instance? It may be that the old version of the DLL is still in memory and so your new one isn't being loaded.
If you've tried that and it doesn't work, if you can run regedit on the server and find the entry under HKEY_CLASSES_ROOT for 'GMSAutoRoll.clsRole'.
It should have a single CLSID entry underneath it of the form {xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx}.
There should be a key with this CLSID under HKEY_CLASSES_ROOT\CLSID.
Under this key you should find an InprocServer32 entry. You need to check that this has a value that points to your new DLL.
I can't imagine that this will be wrong if you have followed the regsvr32 steps you put in your post.
If the restart SQL doesn't work I think we need to get some tracing in the COM DLL. I'll have a think.
Sergey Alexandrovich Kryukov at 14-Feb-13 11:36am
   
Makes sense...
—SA
CHill60 at 15-Feb-13 12:20pm
   
Even if these steps don't solve this problem you might like to consider posting your suggestions so far as a solution to aid any searchers. If the "solution" already posted gets deleted then all of the useful comments may be lost
Adwaitam at 18-Feb-13 9:00am
   
I used the VB decompiler to decompile the dll. Both the old one and the new one.
I don't know why the startup class in my dll is not the same as old dll and the my dll does't contain the class itself, I guess.
 
Following is the structure:
 
old DLL: following is a part of native code
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#........\WINDOWS\SYSTEM32\STDOLE2.TLB#OLE Automation
Class=clsDeal; clsDeal.cls
Class=clsAudit; clsAudit.cls
Module=mRoll; mRoll.bas
Class=clsPDA; clsPDA.cls
Class=clsContract; clsContract.cls
Startup="clsDeal"
IconForm="clsDeal"
HelpFile=""
ExeName32="GMSAutoRoll"
Name="GMSAutoRoll"
Title="GMSAutoRoll"
VersionCompanyName="Duke Energy Field Services"
MajorVer=6
MinorVer=4
RevisionVer=3
 
new DLL(the one which I have created): following is a part of native code
 
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#........\WINDOWS\SYSTEM32\STDOLE2.TLB#OLE Automation
Module=mRoll; mRoll.bas
Startup="clsRoll"
IconForm="clsRoll"
HelpFile=""
ExeName32="GMSAutoRoll"
Name="GMSAutoRoll"
Title="GMSAutoRoll"
VersionCompanyName="Duke Energy Field Services"
MajorVer=6
MinorVer=4
RevisionVer=3
 
I tried by keeping the version same as well as different different.</pre>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100