Can a COM object read registry values?

05-16-2002, 02:47 PM
I have VB com object that uses the GetSetting function to return values from the servers registy. When called from an asp page nothing is returned.

Is it possible to do this (read registy values)? I would think it could since its reading from the servers registry and not the client.

05-16-2002, 02:51 PM
COM objects in ASP can be somewhat of a pain.

Answer these two questions:

1) Did you transfer a class function from a regular vb project into the COM object?

2) Does the function in the COM object return a value? If so, what type?

05-16-2002, 02:58 PM
1.) no, it was created as an ActiveX dll
2.) no, nothing is returned

Here is what I am trying to do:
1.) I created a vb exe that is a form that saves oledb connection properties to the server registry using the savesetting function.

2.) asp then calls the dll

3.) DLL - Read the registry, open a connection using the values, read a text file and load it into the db, close text file, return to asp

Here is the code:
sDBProvider = GetSetting("MSI_CG", "DBConnect", "OLEDBProvider")
sDBSource = GetSetting("MSI_CG", "DBConnect", "Server")
sDBName = GetSetting("MSI_CG", "DBConnect", "Catalog")
sDBUser = GetSetting("MSI_CG", "DBConnect", "Userid")
sDBPassword = GetSetting("MSI_CG", "DBConnect", "Password")

oConn.Open "Provider=" & sDBProvider & ";Data Source=" & sDBSource & ";" & "Initial Catalog=" & sDBName & ";", sDBUser, sDBPassword

The connection fails because all of the variables (ie sDBSource etc) are null

Thanks for the help.

05-17-2002, 07:52 AM
Where are you setting the variables into the registry? With the COM object or through VB?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum