VB / RDS Problem

Hi !

Here is my case :
I have COM object (that is written in VB6) which is DLL. I need to work with this  object remotely via HTTP (via RDS.DataSpace Object). In addition, my DLL is placed in the MS Transaction Server.

Here is my code :

Dim ds As New RDS.DataSpace
Dim phRS As ADODB.Recordset

Set obj = ds.CreateObject("ADOTest.GetRecordset", "http://xxx")

Set phRS = obj.GetRecordset(3, 2)

MsgBox phRS.Fields.Item(1).Name

And now the problem :
I have 2 remote Windows NT 4.0 Servers, while there is no error in one of them, at the second the phRS
variable is returned “nothing”. I have checked the possible security settings (dcomcnfg.exe) but nothing
helps. I have also rechecked  the object – it’s registered and it’s the same object.

What can be wrong ?

Thanks a lot !

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is the security for the MTS package enabled, and for MTS it self ?

You need to register your Dll to be launched in Http protocol.

--> Open the notepad and paste the code below :


;Mark Clsid 0413E440-0962-11D1-83D1-00C04FC30912 as safe

[HKEY_CLASSES_ROOT\CLSID\{0413E440-0962-11D1-83D1-00C04FC30912}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]
[HKEY_CLASSES_ROOT\CLSID\{0413E440-0962-11D1-83D1-00C04FC30912}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]

--> Change then class id from 0413E440-0962-11D1-83D1-00C04FC30912 to your Class Id (don't change the value : 7DD95801-9882-11CF-9FA9-00AA006C42C4)

--> Save as dcom_Safe.reg

--> Open a New file.

--> Put the code below :



--> change the 'ADOTest.GetRecordset' for what you want, in my case is : 'BusObj.BusObjCls'

--> Save as Launch_safe.reg

--> Run both with double click in each.

--> Test your client program.

If doesn't work, check your Dll code, I have a application thats use the same way that you want, and works fine, A  example of my dll :

'Project Name : BusObj
'Class Name : BusObjCls

'The function that returns the Recordset
Public Function GetRecordset(ByVal Connect As String, ByVal SQL As String) As ADOR.Recordset
  'this function returns an ADODB recordset object
  On Error GoTo ehGetRecordset
  Dim objADORs As New ADODB.Recordset                      'ADO must be registered locally
  objADORs.CursorLocation = adUseClientBatch               'this property is not visible in v1.0 typelib
  objADORs.Open SQL, DB, adOpenUnspecified, adLockBatchOptimistic, adCmdUnspecified
  Set GetRecordset = objADORs                              'set object pointer for ADOR type recordset
Exit Function
  Err.Raise Err.Number, Err.Source, Err.Description
End Function

-- My client code :

Private ads As New RDS.DataSpace
Private bo as Object
Private Sn as Object 'The Record set, you can change to ADODB.Recordset

StrConn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=;Initial Catalog=DATABASENAME;Data Source=SERVER"

Set ads = CreateObject("RDS.DataSpace")
Set bo = ads.CreateObject("BusObj.BusObjCls", "Http://xxx")

sql = "SELECT * FROM xxx"
Set Sn = bo.GetRecordset(StrConn, sql)

--> Don't forget about check if your class run in each activation level (Library Package or Server Package) in MTS.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ax21Author Commented:
Unfortunatelly, I don't have time to deal with this problem, so I just hope it would help...
Thanks. Tell me if you want more info or you have any doubts.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.