Article View: borland.public.cppbuilder.database.ado
Article #937TADOConnection LoginPrompt workaround
From: Tumurbaatar S.
Date: Fri, 18 Mar 2005 10:24
Date: Fri, 18 Mar 2005 10:24
23 lines
1794 bytes
1794 bytes
I had a problem on bringing up a default login dialog
when TADOConnection::ConnectionString does not
contain UserID/Password. Even LoginPrompt is true
and <DBLogDlg.hpp> is included, the connection
fails with "Invalid authorization specification".
After examining BCB6's ADO and DB source files/includes,
I found that the login dialog appears if LoginDialogExProc variable
is set to a corresponding function: LoginDialogEx.
So before opening a connection I executed below code:
if (LoginDialogExProc == NULL)
ShowMessage("NULL");
if (LoginDialogExProc != LoginDialogEx)
ShowMessage("NOT SAME");
And it returns "NOT SAME" and login dialog does not appear.
Due to this, I added:
LoginDialogExProc = LoginDialogEx;
before connection open and now login dialog works well.
P.S. In my old project which uses TADOConnection with LoginPrompt=true
the login dialog works normally without an additional code. I don't know
why.
Technical Details
Message-ID:
<423aac5b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,fbcdfb63588152ee,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Tumurbaatar S." <nospam_tumur@magicnet.mn> Newsgroups: borland.public.cppbuilder.database.ado Subject: TADOConnection LoginPrompt workaround Date: Fri, 18 Mar 2005 18:24:26 +0800 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 202.131.2.6 Message-ID: <423aac5b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111141467 202.131.2.6 (18 Mar 2005 02:24:27 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail