Results 1 to 3 of 3

Thread: Can anyone find my mistake?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    82

    Can anyone find my mistake?

    I'm using the following code to create one of two possible recordsets, depending on the value in another form. This is using an SQL7 database via ADO. The first possibility (Shop Orders) works fine; the second continually gives me "Item cannot be found in the collection corresponding to the requested name or ordinal". It fails on the "open" statement. Using Query Analyzer, I can run the Stored Proc (sel_styles) and it works fine. Can anyone figure this out???
    Code:
        Dim rsListing As New ADODB.Recordset
        Dim objCmd As ADODB.Command
        
        Set objCmd = New ADODB.Command
        With objCmd
            .ActiveConnection = PROJ_DB
            .CommandType = adCmdStoredProc
            If frmShopOrder2.txtShopOrderNo = "?" Then
                .CommandText = "sel_shoporder"
            ElseIf frmShopOrder2.txtStyle = "?" Then
                .CommandText = "sel_styles"
            End If
        End With
        With rsListing
            .CursorLocation = adUseClient
            .CursorType = adOpenKeyset
            .Open objCmd
        End With
        Set objCmd = Nothing

  2. #2
    Lively Member
    Join Date
    Jan 2001
    Location
    Bradenton, FL
    Posts
    87
    i give up...where's waldo?

  3. #3
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Leavenworth KS USA
    Posts
    482
    It's a shot from the hip, but this may help:

    http://support.microsoft.com/support.../Q197/5/28.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width