Results 1 to 5 of 5

Thread: report based on SQL

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    report based on SQL

    Hi
    I have a form that contains a command "Generate Report",the report is based on a query,but the problem is that depending on the users' entries,the query changes, so before generating the report, the program should take the SQL statement and then generating the report using the Data report that comes with VB6.
    I tried using the stored procedures but it didn't work
    is that another solution
    thanks

  2. #2
    Hyperactive Member binilmb's Avatar
    Join Date
    Nov 2005
    Location
    Kochi
    Posts
    472

    Re: report based on SQL

    You Can do like this

    VB Code:
    1. If DEnvir.rsCommand1.State = 1 Then DEnvir.rsCommand1.Close
    2.             DEnvir.rsCommand1.Open [Your Sql Statement here]
    3.             Report1.Show
    ßįňįl

  3. #3
    Hyperactive Member binilmb's Avatar
    Join Date
    Nov 2005
    Location
    Kochi
    Posts
    472

    Re: report based on SQL

    And

    Give Sql Statement in the Command as

    "Select * from Tablename"

    when calling the report using user entries

    you query will be


    "Select * from Tablename where fieldname='value'"

    that means the fields in the sql of command and ur sql should match.
    ßįňįl

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Re: report based on SQL

    thanks binilmb

    but when i run my code the following message appears:
    Error wrapping lines of text in control 'Label1'

    I know this is a report design error but what's the origin of this error?

  5. #5
    Hyperactive Member binilmb's Avatar
    Join Date
    Nov 2005
    Location
    Kochi
    Posts
    472

    Re: report based on SQL

    Give "Cangrow" property to true and check
    ßįňįl

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