From: "Mark Edington (Borland)" Subject: Re: Briefcase ADO Demo Program Date: 04 Feb 2000 00:00:00 GMT Message-ID: <87f5qd$5lc5@bornews.borland.com> References: <87a644$2ku10@bornews.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Inprise Corp. X-MSMail-Priority: Normal Newsgroups: borland.public.delphi.database.ado Earl F. Glynn wrote in message news:87a644$2ku10@bornews.borland.com... > If you set the Active property to True in Employees (a TADODataset), one can > view data in the IDE as expected. But when you run the program, I see the > error message > "The operation requested by the application is not allowed if the object is > open." The demos is designed in such a way that it will only work correctly if the dataset is closed at design time. This is becuase it needs to make a determination at runtime of where to get the data. > This can only be corrected by setting Active back to False, and then > respecifying the ConnectionString in the TADOConnection back to the > originally-specified UDL file. When setting Active to True on the > TADODataset, it's as if the UDL specified is read and is used to replace > the ConnectionString with a new definition. The original > ConnectionString UDL definition is lost. Is this expected behavior? The ConnectionString getting expanded from the UDL filename to a complete connection string is something that the ADO connection component does. If you close the connection it will revert to the UDL filename. However, if you save the form and reload it while the connection is open, then refernce to the UDL filename is lost completely. The VCL needs to preserve the original connection string (with the UDL filename) in this case, but it doesn't currently do that. That's something I plan to fix for the next release. > Also, since the ConnectionString is specified in the IDE, why does the > Form1Create define it again? The value returned by the DataLinkDir function will be different than the path in the TADOConnection component if Delphi is installed on a machine with a different path to "c:\program files". This is the case on some international versions of Windows. Mark