|
-
Aug 1st, 2000, 08:21 AM
#1
Thread Starter
Addicted Member
Howdy!
Is it possible to create a Data Environment through code and then connect a data report to it? If so, How?
Because,I have a Data environment with a report connected to it.
But, I need to change the SQL statement in the Data environment during run-time! - That is my goal!
Thanx
[Edited by hyme on 08-01-2000 at 09:30 AM]
-
Aug 1st, 2000, 08:59 AM
#2
Junior Member
you have a few ways of doing this
1 use stored procedures on the data base and pass them parameters(best option)
2 create a command and pass this a paramater like a stored procedure(but its not compiled on the database so not as quick- second best option)
3 or create a comand and set its comandtext property at run time by creating a sql string ie
strsql = "select * From table"(create sql string)
dataeviroment.comandname.comandtext = strsql
hope this is helpful
*** note might not be the right syntax
-
Aug 1st, 2000, 09:05 AM
#3
Thread Starter
Addicted Member
It's a great help
I can change the Data Environment like this:
DE.Commands("cmFormu").CommandText = "Select * from Client ORDER BY Index"
But, how to you update the text fields on a Data Report
attached to it?
I get the error
"datafield "cmFormu.Client.Index not found"
-
Aug 1st, 2000, 09:48 AM
#4
Junior Member
the datafild should update correctly!
so try your query inside the of the command query builder and run it there
if it works there then it will work by setting the comand text property
if it dosnt work check to see if the the query is correct(sounds like it carnt find the index coloum in the data base) and make sure that the text box is bound correctly
(not likly as its throwing an error at the command text you quoted in the cmdtext property!!)
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
|