Article View: borland.public.cppbuilder.database.ado
Article #627Re: ADO begginer
From: Viatcheslav V. Vassiliev
Date: Tue, 01 Nov 2005 09:11
Date: Tue, 01 Nov 2005 09:11
50 lines
3244 bytes
3244 bytes
TDataSource and TDBGrid are not instead of TADODataSet and TADOTable. TADODataSet, TADOTable, TADOQuery hold data obtained from table or query, but they are not controls (descendants from TControl) and can not display data to user. TDataSource is used to link any TDataSet descendant to db-aware controls, such as TDBGrid, TDBEdit etc. TDBGrid is visual control used to display data from any TDataSet, it does not contain any data, only displays them. //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net http://www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "poojo hackma" <poojo.com/mail> �������/�������� � �������� ���������: news:43667ddf$1@newsgroups.borland.com... > Wow! Great post! This thread was very helpful, and it saved me hours of > work! > > On step 14, I noticed you used TDataSource and TDBGrid instead of ADO's > TADODataSet and TADOTable. Why not stick with all ADO components? Is > this just personal preference, or is there something more? (Remember: I > am a newbie at this) > > "Viatcheslav V. Vassiliev" wrote... >> 1. Create new project. >> 2. Drop TADOConnection on main form. >> 3. Press "ConnectionString button" (...). >> 4. Press "Build". >> 5. Choose "Microsoft Jet 4.0 OLE DB provider". Press "Next" >> 6. Set Data Source to "C:\Temp\Test.mdb" or to .mdb file you have. >> 7. Press Check Connection - it should be successfull. >> 8. Press OK. >> 9. Set LoginPrompt property to False; >> 10. Set Connected property to True. >> 11. Drop TADOTable on the form and set its Connection property to >> ADOConnection1. >> 12. Set TableName to "YourTableName" - table name that exists in your >> database. >> 13. Set Active property to True. >> 14. Add TDataSource and TDBGrid on the form, connect them to ADOTable1 as >> usual (set DataSource1's DataSet property to ADOTable1 and DBGrid1's >> DataSource property to DataSource1). >> >> Now you should see your table in grid. >> > >
Technical Details
Message-ID:
<43673122$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42bb2437@newsgroups.borland.com> <42bba97c@newsgroups.borland.com> <43667ddf$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,9b3472ac92b88f2e X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <42bb2437@newsgroups.borland.com> <42bba97c@newsgroups.borland.com> <43667ddf$1@newsgroups.borland.com> Subject: Re: ADO begginer Date: Tue, 1 Nov 2005 12:11:05 +0300 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 85.93.138.132 Message-ID: <43673122$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130836258 85.93.138.132 (1 Nov 2005 01:10:58 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail