Results 1 to 3 of 3

Thread: Command text on Data Enviroment Command

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    England
    Posts
    3

    Question

    Here's a little problem that is really bugging me, I hope someone has had it before.
    I'm using a data enviroment with one or more commands as the source for data reports, it all works fine until I try to set the connection string of the DEconnection and the command text of the DEcommand programatically. This generates an error "method 'item' of object 'commands' failed". If I use the on error resume next and repeat the command text it works ok - but it's not very elegant. Hope one of you gurus out there can help.

  2. #2
    Addicted Member
    Join Date
    Sep 1999
    Location
    Philippines
    Posts
    196
    Make sure that the fields in your dataenvironment command are the same as the new sql string you are placing.


    also, after you have set the new datasource name, try

    dim strnewcon as string

    deconnection.properties("Data Source").value equals (my equal sign does not work) "C:\database\data.mdb"
    strnewcon equals deconnection.connectionstring
    deconnection.connectionstring equals strnewcon

    looks weird but at times it solves problems.


  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    England
    Posts
    3

    Smile

    Thanks for the help, it didn't work but it put me in the right direction. The problem turned out to be the DEconnection.ConnectionString. The ConnectionString property can only be set at run time, while the ConnectionSource property can only be set at design time. The Conection String is made up of 2 parts (the connection string first then the connection source appended).

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