Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

TDataset & TDatasource

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Charl van Jaarsveldt

Hi All,
I have never really gotten into working with the datasets and datasources with Delphi or Lazarus. Can someone perhaps point me to some good online documentation/tutorial (or write a quick summary of you feel like it :-) ) that can help me get on with this? I have the basics down, in other words, I have a program that can read/write stuff to an sqlite database. I am getting a little confused though when I start thinking about some design considerations. What exactly is the relationship between the TDataset and TDatasource? Should you have a separate TSQLiteDataset for each use of a table? (I think I need to implement an onscroll event, but only for one frame.) Any help would be appreciated.

Thanks!
Charl

"See first, think later, then test. But always see first. Otherwise you will only see what you were expecting. Most scientists forget that." - Douglas Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081202/150d0e9f/attachment.html

Reply by email

Luiz Americo Pereira Camara
to Charl van Jaarsveldt
Charl van Jaarsveldt wrote 9 lines
Hi All, I have never really gotten into working with the datasets and datasources with Delphi or Lazarus. Can someone perhaps point me to some good online documentation/tutorial (or write a quick summary of you feel like it :-) ) that can help me get on with this? I have the basics down, in other words, I have a program that can read/write stuff to an sqlite database. I am getting a little confused though when I start thinking about some design considerations. What exactly is the relationship between the TDataset and TDatasource?

I would recommend to read the Delphi help files about those classes

Should you have a separate TSQLiteDataset for each use of a table?

It's not necessary, one TSqliteDataset can have data from more than one table or even data from views or joins or whatever SQL allows, but it's a recommended approach for those starting with TDataset/TSqliteDataset.

(I think I need to implement an onscroll event, but only for one frame.) Any help would be appreciated.

I would recommend using TSqlite3Dataset (sqlite3) instead of TSqliteDataset (sqlite2).

Some docs are here: http://www.geocities.com/camara_luiz/documentation.html

Luiz

Reply by email

Lee Jenkins
to Charl van Jaarsveldt: I have never really gotten into working with the datasets and datasources with Delphi or…
Charl van Jaarsveldt wrote 13 lines
Hi All, I have never really gotten into working with the datasets and datasources with Delphi or Lazarus. Can someone perhaps point me to some good online documentation/tutorial (or write a quick summary of you feel like it :-) ) that can help me get on with this? I have the basics down, in other words, I have a program that can read/write stuff to an sqlite database. I am getting a little confused though when I start thinking about some design considerations. What exactly is the relationship between the TDataset and TDatasource? Should you have a separate TSQLiteDataset for each use of a table? (I think I need to implement an onscroll event, but only for one frame.) Any help would be appreciated.

Charl,

TDataSource is used as a go between for TDataSet and data aware controls. For instance, if you set the Datasource of the TDBGrid it will populate the grid using the TDataset.

This may help you:
http://delphi.about.com/od/database/a/databasecourse.htm

Warm Regards, Lee

Reply by email

Charl van Jaarsveldt
to Lee Jenkins

Thanks for the links! I'll go learning now...

Charl

Lee Jenkins wrote 37 lines
Charl van Jaarsveldt wrote: > Hi All, > I have never really gotten into working with the datasets and > datasources with Delphi or Lazarus. Can someone perhaps point me to some > good online documentation/tutorial (or write a quick summary of you feel > like it :-) ) that can help me get on with this? I have the basics > down, in other words, I have a program that can read/write stuff to an > sqlite database. I am getting a little confused though when I start > thinking about some design considerations. What exactly is the > relationship between the TDataset and TDatasource? Should you have a > separate TSQLiteDataset for each use of a table? (I think I need to > implement an onscroll event, but only for one frame.) Any help would be > appreciated. > Charl, TDataSource is used as a go between for TDataSet and data aware controls. For instance, if you set the Datasource of the TDBGrid it will populate the grid using the TDataset. This may help you: http://delphi.about.com/od/database/a/databasecourse.htm -- Warm Regards, Lee _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
"See first, think later, then test. But always see first. Otherwise you will only see what you were expecting. Most scientists forget that." - Douglas Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081214/63535ccb/attachment.html

Reply by email