BDE to ADO conversion question
I am using Delphi 7, RB 7.01, ADO and MS SQL Server 7/2000/2005.
I have a global TADOConnection that gets assigned to the custom TADOQuery
components at runtime. This was done to ease the BDE to ADO conversion.
Is there a way to have the TddDataDictionary.BuilderSettings.DatabaseName
reference a connection that is not on the form? It works great if I put a
TADOConnection on the form, but not if the ADOConnection gets assigned at
runtime.
I tried working around it by having a local TADOConnection and pointing it
to the global one so the DatabaseName dropdown showed it, but I get the same
error.
"Data source name not found and no default driver specified..."
Any ideas?
I have a global TADOConnection that gets assigned to the custom TADOQuery
components at runtime. This was done to ease the BDE to ADO conversion.
Is there a way to have the TddDataDictionary.BuilderSettings.DatabaseName
reference a connection that is not on the form? It works great if I put a
TADOConnection on the form, but not if the ADOConnection gets assigned at
runtime.
I tried working around it by having a local TADOConnection and pointing it
to the global one so the DatabaseName dropdown showed it, but I get the same
error.
"Data source name not found and no default driver specified..."
Any ideas?
This discussion has been closed.
Comments
cross post.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for reading past the subject. Can you have another look?
I sincerely apologize, usually when I see the same subject for a post from
the same person, I assume it is a cross post .
Where is this global ADO connection located and what is its owner? If you
take a look at the daADO.pas file in the TdaADOSession.GetDatabaseNames
routine you will see that ReportBuilder searches through each form and
datamodule to compile a list of available ADO connections. You could alter
this code to include your global ADO connection as well.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks Nico. I'll try to make a better subject line next time.
The global connection does now have an owner and it's created in the
initialization section so that my queries will work in the Delphi IDE. I
got around the problem by adding a connection component to my report writer
form and assigning the ConnectionObject from my global. This worked out
better for my "cross post" issue (hehe) where I want to load legacy BDE
reports since the database name stored in the reports was different than my
global.