CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    1

    Query Finished Successfully

    Trying to read data from a DB2 table on a mainframe. I don't get any VB error events. The connection object is open but the record count is -1. When running the SQL in the designer I get Query Finished Successfully, but no records returned in the table viewer. Any ideas???
    Thank you in advance


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Query Finished Successfully

    Judging to the looks of that, I would think that the statement simply doesn't return any records. Check, and double check the statement if you are sure that you need records to be returned. Also note that some syntax may change from platform to platform. For example, MSAccess uses * as wildchar, while SQL Server uses %, I don't know what DB2 uses, but it's worth checking out.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Query Finished Successfully

    Not every recordset support the recordcount property. It might be the case with DB2. Make sure that your cursor is client side (only this type of cursor support recordcount).
    To check if the recordset has records you can count records using SQL
    "select count(*) as RC from Table"
    rs.Open SQl...
    RecordCount = rs!RC

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured