Article View: borland.public.cppbuilder.database.ado
Article #3972Re: ADO Connection string
From: Big Stew
Date: Tue, 30 Apr 2002 11:00
Date: Tue, 30 Apr 2002 11:00
58 lines
2220 bytes
2220 bytes
Cheers Daryl. Well you learn something new everyday don't you?
This works very nicely (providing you set the login name, and password);
void __fastcall TForm1::Button1Click(TObject *Sender)
{
WideString StrCon = PromptDataSource((int)Handle, "") ;
if (!StrCon.IsEmpty())
{
ShowMessage(StrCon) ;
TADOConnection* ADOCon = new TADOConnection(NULL) ;
try
{
ADOCon->ConnectionString = StrCon ;
ADOCon->LoginPrompt = false ;
ADOCon->Open() ;
TStringList* S = new TStringList() ;
try
{
ADOCon->GetTableNames(S, false) ;
// Test the connection by listing all tables
ShowMessage(S->GetText()) ;
}
__finally
{
delete S ;
}
}
__finally
{
ADOCon->Close() ;
delete ADOCon ;
}
}
}
BigStew
"Daryl" <stockd@cqnet.com.au> wrote in message news:3cce6c0e_2@dnews...
> Try the undocumented function call PromptDataSource(); apparently it can
be
> found in ADODB.hpp include file. I have never tried it but I read about
it
> in text.
>
> WideString PromptDataSource (int theWindowHandle, WideString
> theOriginalConnectionString);
>
>
> "minshung" <minshung@yahoo.com> wrote in message
news:3cce60bf$1_1@dnews...
> > How can I pop up ADO Connection String builder at run time using BCB ??
> >
> > Alex
> >
> >
>
>
Technical Details
Message-ID:
<3cce7981_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3cce60bf$1_1@dnews> <3cce6c0e_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,d77f6a8ecb8da4e0 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-04-30 04:06:22 PST From: "Big Stew" <Big_Stew@talk21.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3cce60bf$1_1@dnews> <3cce6c0e_2@dnews> Subject: Re: ADO Connection string Date: Tue, 30 Apr 2002 12:00:39 +0100 Lines: 60 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.19.90.97 Message-ID: <3cce7981_2@dnews> X-Trace: dnews 1020164481 212.19.90.97 (30 Apr 2002 04:01:21 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews