|
-
Jun 20th, 2006, 02:24 AM
#1
Thread Starter
Fanatic Member
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
-
Jun 20th, 2006, 03:07 AM
#2
Hyperactive Member
Re: report based on SQL
You Can do like this
VB Code:
If DEnvir.rsCommand1.State = 1 Then DEnvir.rsCommand1.Close
DEnvir.rsCommand1.Open [Your Sql Statement here]
Report1.Show
-
Jun 20th, 2006, 03:10 AM
#3
Hyperactive Member
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.
-
Jun 20th, 2006, 05:42 AM
#4
Thread Starter
Fanatic Member
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?
-
Jun 24th, 2006, 04:33 AM
#5
Hyperactive Member
Re: report based on SQL
Give "Cangrow" property to true and check
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|