|
-
May 15th, 2000, 12:50 PM
#1
Thread Starter
New Member
Hi,
I've built an ASP page which uses an activeX DLL to retrieve data from a database.
The function which retrieves the data (in side the DLL) loocs like :
Public function GetRS(ByVal ID as integer, Optional ByRef Hresult as Variant) as ADODB.Recordset
The function builds a recordset and uses the Hresult variant to return Error Codes.
I developed that DLL as a normal DLL, It worked grate the recordset was created and the Hresult returned Errors as planed, so I happily moved to the 2nd stage which was to place the DLL in a MTS.
When I placed the DLL in the MTS Hresult stopped working. My ASP received the recordset correctly but did not get the Hresult values (Hresult is always empty).
Way Is that ?
Thanks
Erez
-
May 15th, 2000, 02:35 PM
#2
Addicted Member
Hi there,
This is an extract of an article on best practices for building VB COM objects to be used with ASP:
http://support.microsoft.com/support.../Q243/5/48.ASP
ByRef parameters should be passed as Variant while ByVal parameters can be specific data types. For additional information.
Search for:Passing Parameters By Reference to a VB COM Object
Do not register your component with MTS unless you need transactions. ObjectContext can be expensive in terms of performance.
cheers,
André
-
May 15th, 2000, 02:39 PM
#3
Addicted Member
Hmmmm, Hi again, I see from your code line that it is a function. The function will only return a recordset, no Hresult!, if you want to put a value in Hresult, maybe you need a Public Sub GetRS(ByVal ID as integer, Optional ByRef Hresult as Variant, RS as ADODB.Recordset )
André
-
Jun 7th, 2000, 01:04 AM
#4
Thread Starter
New Member
Using ByRef Parameters in MTS objects - Conclusion
Hi,
Ok, At last it works and there are our conclusions from our ordeal with IIs and MTS :
1) Use ADO 2.1 and to ADO 2.0
2) Use "CreateObject" insted of <OBJECT>
3) dont use function AI public function <name>(<input params>) as <return val>
Create all your objects in the IIS and send them "By Ref" to the MTS
object. AI public sub <name>(<input Parameters>, <Output Parameters>)
Have fun
Erez
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|