🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4028

Re: ADO Connection

#4028
From: Vassiliev V.V.
Date: Mon, 22 Apr 2002 08:52
74 lines
3250 bytes
Do not set DefaultDatabase. Open() and Connected = true are the same -
choose one of them. Does your server support integrated security? If not,
use UserID and Password instead of Integrated Security=SSPI.

Try connect to your server at design-time:
Place TADOConnection on the form.
Set LoginPrompt to false.
Double-click on ConnectionString property.
Check Use Connection String.
Press Build.
Choose "Microsoft OLEDB provider for SQL Server".
Set required properties.
Check connection.
Press OK.

You should see a valid connection string that you can use in your code. Most
times you can remove some values from this string.

Press OK again.
Set Connected property of ADOConnection1 to true. If you are connected -
place Connection string into your code. It should work.

If you can not connect from this dialog - check your SQL Server settings.

Regards,
Vassiliev V.V.
http://www.oledbdirect.com

"Aris" <ashokooh@centennialpr.net> �������/�������� � �������� ���������:
news:3cc2ed68$1_2@dnews...
> Many thanks for the suggestion.  But I have done all these and it doesn't
> work   here is my code:
>
>
>
>         ADOConnection1->Connected = false;
>
>         ADOConnection1->LoginPrompt = false;
>
>         ADOConnection1->ConnectOptions = coConnectUnspecified;
>
>         ADOConnection1->ConnectionString =
AnsiString("Provider=SQLOLEDB.1;
>
>                         Integrated Security=SSPI;Persist Security
> Info=False;Initial Catalog=MyDatabase;
>
> Data Source=RXC;");
>
>         ADOConnection1->DefaultDatabase= " MyDatabase";
>
>         ADOConnection1->Open();
>
>         ADOConnection1->Connected = true;
>
>
>
> (RXC is the server name). The error message is by the SQL server
indicating
> that it cannot login to the database MYDatabase.  I am doing everything by
> the book.  Where is the error?
>
> "Aris" <ashokooh@centennialpr.net> wrote in message
news:3cc228d0_2@dnews...
> > I am having difficulty making run-time connection to MS SQL Server 7
> > (SQLOLEDB.1 provider) using ADOConnectionString in BCB5. I need concrete
> > help:  C++ statements showing clearly how to do it.  Will appreciate it
> > greatly.
> >
> > Aris
> >
> >
>
>
Technical Details
Message-ID: <3cc3d223_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3cc228d0_2@dnews> <3cc2ed68$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,f7dc40439631c1c0
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-04-22 02:15:35 PST
From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3cc228d0_2@dnews> <3cc2ed68$1_2@dnews>
Subject: Re: ADO Connection
Date: Mon, 22 Apr 2002 12:52:09 +0400
Lines: 76
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: 62.118.131.19
Message-ID: <3cc3d223_2@dnews>
X-Trace: dnews 1019466275 62.118.131.19 (22 Apr 2002 02:04:35 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews