[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

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 !

  • 2
1 Solution
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.
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.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now