Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_ado_rds thread: CreateObject(RDS.DataSpace) Not Working


Message #1 by RichSorensen@m... on Fri, 27 Dec 2002 21:58:15
Hello,
   I wrote a custom business object in vb which will be used by an 
RDS.DataSpace object in a client-side ASP page.  I keep getting the 
error "Business object cannot be created."  I have set the ADCLaunch 
registry key and set the folder options for the msadc virtual directory. 
I am testing the COM object and pages on IIS 5.1 with IE 6.  I tried the 
business object in VB by adding a second project and it worked(using a 
direct reference). If I use CreateObject("RDS.DataSpace") the VB group 
stops responding and I have to shut it down. 
Here's the code:
DLL
--------
Function getCategories(propID As String) As ADODB.Recordset
    Dim Conn As ADODB.Connection
    Dim RS As ADODB.Recordset
    Dim SQL As String
    
    Set Conn = New ADODB.Connection
    Set RS = New ADODB.Recordset
    
    On Error GoTo errHandler
    Conn.Open "DSN=Test", "sa", ""
    
    SQL = "Exec spInvoiceCategory " & propID 'execute stored procedure
    RS.CursorLocation = adUseClient
    RS.Open SQL, Conn, adOpenDynamic, adLockBatchOptimistic
    Set RS.ActiveConnection = Nothing
    Set getCategories = RS
    
    Conn.Close
    Set RS = Nothing
    Set Conn = Nothing

Exit Function
errHandler:
    MsgBox ("error") 'only used for testing purposes

End Function  

JavaScript Code
---------------
var strServer = "http://<%=Request.ServerVariables("SERVER_NAME")%>";
var strCombo, dFactory, rsCategories
	
dFactory = ADS.CreateObject("Test.Class1", strServer);
rsCategories = dFactory.getCategories("1780"); ** Error occurs here
dsoCategory.SourceRecordset = rsCategories;

I would appreciate any help,
Thanks

  Return to Index