CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Location
    IN
    Posts
    24

    Data Environment

    I have created a data environment, a connection, and a command within the data environment designer. I then bound a report and it's controls to that command. My problem is that when you use the data environment, you set the location of the database in the connection properties at design time. This is fine during design, but I need to be able to move the program around and therefore be able to change the location of the database programatticaly. How can you set this location programatically? I have tried altering the ConnectionString at run-time, but when I run the report bound to it, I receive an error: Method 'Item' of Object 'Commands' failed. This error occurs when I try to set the parameter of the parameterized query that I am using for the command object. Once I receive this error, I can click debug, then click "Play" again and it will work fine. But this error only occurs if I change the ConnectionString, otherwise everything works perfect. So this takes me to trying to figure out how to set the location of the database at run-time. If anyone has any suggestions, I would appreciate it. Thanks in advance.


  2. #2
    Join Date
    Apr 2000
    Location
    Winston-Salem, NC
    Posts
    32

    Re: Data Environment

    de.Cn.ConnectionString = GetConnectionString

    == Ali R. Tahbaz, MCSD ==========================
    "Whether you think that you can, or that you can't, you are usually right."
    --Henry Ford

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

Featured