On 04/28/00, ""Kevin Riggs" <kevin.riggs@p...>" wrote:
Public Function listModels() As Object
On Error GoTo BadList
conn.ConnectionString = "DSN=laspas"
Set listModels = conn.Execute("SELECT * FROM tblModels ORDER BY
Model")
Exit Function
BadList:
Debug.Print Err.Number & Err.Description
Set listModels = Err
Err.Clear
End Function
Private Sub Form_Load()
Set objModels = New SpaService.Models
Fill_Models
End Sub
Private Sub Fill_Models()
Set rs = New ADODB.Recordset
'**************************************************************
' The following line is the one that appears to cause trouble *
Set rs = objModels.listModels '*
'**************************************************************
End Sub
Question: Not having seen the code in the book, what is SpaService.Models.
if it is not a recordset, there's your trouble. You are trying to set an
object specfically declared ADODB.Recordset as type SpaService.Models. If
these objects are different, you have a type 13 error. You would find the
error in a different spot if the code did not declare ListModels as an
object.
GB