Results 1 to 4 of 4

Thread: Data Environment - HELP!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148

    Exclamation

    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]

  2. #2
    Junior Member
    Join Date
    Dec 1999
    Location
    westmids
    Posts
    18
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148
    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"


  4. #4
    Junior Member
    Join Date
    Dec 1999
    Location
    westmids
    Posts
    18
    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
  •  



Click Here to Expand Forum to Full Width