🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ADO without ADOExpress

#5257
From: Sandor Bognar
Date: Wed, 27 Jun 2001 06:38
36 lines
2275 bytes
First of all I'd like to note that I'm not an ADO expert. I was interested
in how to distibute an ADO application, and forget it...

> Thanks for the help Sandor
> The program will compile but throws an error after it has compiled. Does
the code below look correct or have I gone wrong somewhere.

Could you be more specific describing the error message and the
circumstances?


> void __fastcall TForm1::FormCreate(TObject *Sender)
> {
> _RecordsetPtr pRecSet;
> wchar_t *ConnStr=L"D:\Inetpub\wwwroot\BMD\bmdtest.mdb";
> pRecSet = CreateComObject(CLSID_Recordset);
> pRecSet->Open(L"SELECT * FROM EssxBmd", ConnStr, adOpenStatic,
adLockReadOnly, adCmdText);
> pRecSet->MoveFirst();
>
> TVariant vVAlue = pRecSet->Fields->get_Item(2)->get_Value();
> Memo1 -> Lines -> Add (vVAlue);
>
> pRecSet->Close();
> pRecSet->Release();
> }

But before you send the error message :
I believe the ConnStr is wrong. One way to open the table is, if you pass
one of the already specified DSN names in the ODBC manager. The other way is
a "DSN-less" connection, which looks similar to your example, but you have
to specify the driver, user, password etc. also. I strongly recommend to
look the details and the overviews in the MSDN library...

HTH
Sandor
Technical Details
Message-ID: <3b397f61_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b179e3c_1@dnews> <3b1de867_1@dnews> <3b371915$1_1@dnews> <3b3838bb_2@dnews> <3b387689$1_2@dnews> <3b388231$1_1@dnews> <3b389df7$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,e13bb3fb20c1e339
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-06-26 23:39:31 PST
From: "Sandor Bognar" <bognars@mail.uti.hu>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3b179e3c_1@dnews>  <3b1de867_1@dnews>  <3b371915$1_1@dnews>  <3b3838bb_2@dnews>  <3b387689$1_2@dnews>  <3b388231$1_1@dnews>  <3b389df7$1_1@dnews>
Subject: Re: ADO without ADOExpress
Date: Wed, 27 Jun 2001 08:38:14 +0200
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 213.163.25.102
Message-ID: <3b397f61_2@dnews>
X-Trace: dnews 993623905 213.163.25.102 (26 Jun 2001 23:38:25 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews