Results 1 to 2 of 2

Thread: [RESOLVED]selecting string from field error

Threaded View

  1. #1

    Thread Starter
    Lively Member George-LSA's Avatar
    Join Date
    May 2004
    Location
    Sydney, Australia
    Posts
    126

    Resolved [RESOLVED]selecting string from field error

    i got an error while trying to compile the following code

    VB Code:
    1. Dim strWO
    2. Dim strStatus
    3. Dim rs
    4. Dim strCnn
    5. Dim strSQL
    6.  
    7. strCnn="DSN=blabla;USER ID=blabla;PASSWORD=blabla;"
    8.  
    9. strWO=WORKORDER_BASE_ID
    10.  
    11. strSQL="SELECT USER_2 FROM REQUIREMENT WHERE
    12. WORKORDER_BASE_ID='02028'"
    13.  
    14. Set rs=CreateObject("ADODB.Recordset")
    15.  
    16. rs.Open strSQL, strCnn
    17.  
    18.      IF not rs.eof Then
    19.     [b]USER_7 = rs("USER_1")[/b]
    20.     USER_8 = rs("USER_2")
    21.     USER_9 = rs("USER_3")
    22.     MACRO_SUCCESS = TRUE
    23.      ELSE
    24.     MACRO_SUCCESS = FALSE
    25.     MACRO_MESSAGE = "No Records Found"
    26.      END IF
    27.  
    28. rs.Close
    29. Set rs = Nothing
    30. Set strCnn = Nothing

    the error i recieved is "item cannot be found in the collection corresponding to the request name or ordinal". the error is on line 19. i have put it in bold

    can someone please give me a hand on this one

    thank you
    Last edited by George-LSA; Jun 27th, 2005 at 03:12 AM.
    Kind Regards,

    George S
    LSA Australia Pty Limited
    www.lsaa.com.au

    -----------------------------------------

    CCNA and CCNP certified
    Visual Basic 6 Developer
    -----------------------------------------
    Dont forget to Rate a post that Helped you
    And mark a post [RESOLVED] when your problem has been resolved.

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