Article View: borland.public.cppbuilder.database.ado
Article #743Re: TADOConnection LoginPrompt workaround
From: Dmitry Konnov
Date: Mon, 28 Mar 2005 14:18
Date: Mon, 28 Mar 2005 14:18
40 lines
2128 bytes
2128 bytes
Hi Tumurbaatar S.
try as variant
PromptDataSource(unsigned(::GetDesktopWindow()), "");
to bring up native ADO dialog
Dmitry Konnov
http://www.weblinedesign.biz
> 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:
<42481266$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<423aac5b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,fbcdfb63588152ee X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Dmitry Konnov" <dmitry@weblinedesign.biz> From: "Dmitry Konnov" <dmitry@weblinedesign.biz> Newsgroups: borland.public.cppbuilder.database.ado References: <423aac5b@newsgroups.borland.com> Subject: Re: TADOConnection LoginPrompt workaround Date: Mon, 28 Mar 2005 18:18:12 +0400 Lines: 42 Organization: weblinedesign X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 212.58.203.114 Message-ID: <42481266$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1112019558 212.58.203.114 (28 Mar 2005 06:19:18 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail