CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    How can I filter a recordset on the server and not localy?

    I use DataEnvironment (VB6) which returns some recordsets. I want to show the data on a data report but I want to display only the data that satisfy some criteria. I use the filter command:
    let's say that the returning recordset from the data environment (deMyEnvironment) is: rsMyRecordset

    deMyEnvironment.rsMyRecordset.filter = " Number > 30 "



    My database (SQL Server 6.5) is very large and the problem is that my program loads all the database in memory, then it executes the query, displays the data I want in a report and only after the program ends, the memory is released. Is that a problem of data environment, of data report or mine? Can I use another way of filtering the data not localy but on the server?
    Thank you!

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  2. #2
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: How can I filter a recordset on the server and not localy?

    You can always use an sql query eg.
    rst.Open "SELECT * FROM mytable WHERE Number > 30"
    ASAIK are queries executed on the server, and this way you only get the records that match the criteria.
    And use indices...

    Crazy D @ Work :-)

  3. #3
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: How can I filter a recordset on the server and not localy?

    What is 'indices'? Do you have experience with data environment and data report?

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  4. #4
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: How can I filter a recordset on the server and not localy?

    Indices is more then one index in a database. This helps to speed up queries in the database, especially usefull in large databases.
    I only used the dataenvironment and the datareport once. I've used it to show only one record, in code I changed the query of the commandobject... don't think I can help you much with that, but I could easily create an sql query in the dataenvironment, so if you only want to show all records that match the criteria (Number > 30) I'd use a query for that.
    Maybe someone else has more experience with the dataenvironment (we usually use crystal reports...)

    Crazy D @ Work :-)

  5. #5
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Ok thanx!

    I think that I must see Crystal Reports. Data Report has a few bugs! If I need an SQL statement I'll ask your help friend because it is not my best! Thank you!

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

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