Article View: borland.public.cppbuilder.database.ado
Article #5259Re: ADO without ADOExpress
From: MIke
Date: Wed, 27 Jun 2001 14:23
Date: Wed, 27 Jun 2001 14:23
56 lines
2707 bytes
2707 bytes
Hi Sandor
I think you are correct about the connection string but I cannot get it to work.
The Microsoft site is good if you are useing Visual C++ but I cannot get the examples to translate to a Borland compiler.
Also it does not help that I am fairly inexperienced at programing. I think I am going to have to give up on this
Thanks ever so much for all your help
Mike
"Sandor Bognar" <bognars@mail.uti.hu> wrote:
>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:
<3b39ec60$2_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!nntp.flash.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<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> <3b397f61_2@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-27 07:24:58 PST From: "MIke" <global@nqe.co.uk> Sender: "MIke" <global@nqe.co.uk> Reply-To: "MIke" <global@nqe.co.uk> Subject: Re: ADO without ADOExpress Newsgroups: borland.public.cppbuilder.database.ado X-User-Info: 213.121.242.170 213.121.242.170 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> <3b397f61_2@dnews> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3b39ec60$2_2@dnews> Date: 27 Jun 2001 07:23:28 -0700 X-Trace: dnews 993651808 207.105.83.65 (27 Jun 2001 07:23:28 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!nntp.flash.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews