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....

The error refers to a naming convention where the spelling is incorrect. Gio through your code and double check all database names, table names and field names where the calls are made. There is nothing wrong with your dll, its the call to the database that is returning an error.

I am sorry sir...
Couldn't find any incorrect spelling

Check your class (clsRoll) if that exists. If so, check that your class can in actual fact perform the action required of it (clsRoll.CheckSchedulesItem) If the .CheckSchedulesItem is not initiated, it will also throw the error.

In lamens terms, if you have a label and you want to add a caption, you have to use the .caption method. If you try to use the .Text method, it will throw a similar error as what you got.

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.

Maybe thats the problem. Have youtried and install/register the old dll again? De-register the new one and then test the app again.

Otherwise, if you have the code for the dll, please post the part where it is erroring on...

You might also have a problem with the startup of the dll, hence the error. The new one might be ok, it just does not start up.

Lets try from teh old first and see how we progress from there...

I have done that also. I registered the old DLL again by unregistering the new one and deploying the old one there. It works fine.

The old DLL works properly.

I am using REGSVR32 "FILEPATH" to register and REGSVR32 /u "FILEPATH" to unregister.

When you register the new one, does it give you the actual message that the registration succeeded? What version of windows are you installing on?

Also, regsvr32 mydllnamehere\pathtosystem32folder - if win7 regsvr32 mydllnamehere\pathtosysWOW64folder

I get the message of successful registration. Sir, I think my DLL creation is not proper.
Can you please tell me how to change the StartUp class. It might be the case that, since my startup class is not correct it is not able to do anything.

I have one more question. If it is not able to get the clsRoll.CheckSchedules item then how the Profiler caught my Query?? the one which I had modified in the CheckSchedules function itself of clsRoll.

Add your class file and the startup form of your application here in zip format. I will have a look at the code to see why it does not initialise at all.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.