Sign in Join

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

Mailing lists / lazarus / 2008-06

Advice about creating database-aware application with Lazarus

36 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

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

Howard Lee Harkness

Did you ever get an answer to this question? I am having a similar difficulty, and information on ApplyUpdates is infuriatingly hard to find.

Adrian Maier wrote 72 lines
On 10/10/06, Joost van der Sluis wrote: > > Well... As I read it, that's not the problem. All changes are made in an > update-buffer first. So if you do a 'delete' in the grid, the records > get deleted in that buffer. Thus the record should disapear immediately > in the grid. But not yet on the database. > > The 'delete'-sql is only send to the database on the .applyupdates > command. And committed on the .commitretaining. Thus that can happen > much later. (on the click on the 'save' button) > > But if I understood you correctly, the delete fails immediately. That > means that there's a problem in the deletion of records in a grid. Or in > the .delete from Tbufdataset. You first have to test that. Easiest way > is to add a button 'delete' which does sqlquery1.delete. That'll delete > the current record, and it should be immediately visible in the grid. > Else you could do a .refresh after the .delete, to be sure that the grid > gets refreshed. (If not, it's a bug, btw) > I've added a button which calls query1.Delete. The row disappears from the grid now. So, it looks like TdbNavigator's "Delete" button does something different than it's supposed to do ? However, when I press "Save" (which does applyupdates and commitretaining) the program crashes with : TApplication.HandleException Access violation Stack trace: $08211A8E $0821AE3F TCUSTOMDBGRID__UPDATESCROLLBARRANGE, line 1336 of dbgrids.pas $0821B013 TCUSTOMDBGRID__DOLAYOUTCHANGED, line 1402 of dbgrids.pas $0821CB35 TCUSTOMDBGRID__ENDLAYOUT, line 2164 of dbgrids.pas $0821B660 TCUSTOMDBGRID__LAYOUTCHANGED, line 1568 of dbgrids.pas $08219DA2 TCUSTOMDBGRID__ONDATASETCHANGED, line 814 of dbgrids.pas $0821E518 TCOMPONENTDATALINK__DATASETCHANGED, line 2722 of dbgrids.pas $0820E0F4 $0820EEF5 $0820F10B $08202E6B $08205F5D $08211320 $08211264 $0807DE10 TFORMASIMPLA__ACTIONCOMMITEXECUTE, line 85 of forma_simpla.pas $0808DDB5 $081755F2 TCONTAINEDACTION__EXECUTE, line 110 of ./include/containedaction.inc In ContainedAction.inc: function TContainedAction.Execute: Boolean; begin Result := (ActionList nil) and ActionList.ExecuteAction(Self) or ((ApplicationActionComponentnil) and ApplicationActionComponent.ExecuteAction(Self)) or inherited Execute // <------------------------- line 110 or (SendApplicationMessage(CM_ACTIONEXECUTE, 0, PtrInt(Self)) = 1); end; Cheers, Adrian Maier _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080614/dad91e93/attachment.html

Reply by email

Joost van der Sluis
to Howard Lee Harkness

Op zaterdag 14-06-2008 om 19:16 uur [tijdzone -0500], schreef Howard Lee Harkness:

Did you ever get an answer to this question? I am having a similar difficulty, and information on ApplyUpdates is infuriatingly hard to find.

You can find this problem in the bug-tracker. You can work around it with 'TDataset.DisableControls' and 'TDataset.Enablecontrols' around the applyupdates call. Or try fpc 2.2.2rc1 or any later version.

Joost.

Show quoted text 105 lines
On Tue, Oct 10, 2006 at 1:11 AM, Adrian Maier wrote: On 10/10/06, Joost van der Sluis wrote: Well... As I read it, that's not the problem. All changes are made in an update-buffer first. So if you do a 'delete' in the grid, the records get deleted in that buffer. Thus the record should disapear immediately in the grid. But not yet on the database. The 'delete'-sql is only send to the database on the .applyupdates command. And committed on the .commitretaining. Thus that can happen much later. (on the click on the 'save' button) But if I understood you correctly, the delete fails immediately. That means that there's a problem in the deletion of records in a grid. Or in the .delete from Tbufdataset. You first have to test that. Easiest way is to add a button 'delete' which does sqlquery1.delete. That'll delete the current record, and it should be immediately visible in the grid. Else you could do a .refresh after the .delete, to be sure that the grid gets refreshed. (If not, it's a bug, btw) I've added a button which calls query1.Delete. The row disappears from the grid now. So, it looks like TdbNavigator's "Delete" button does something different than it's supposed to do ? However, when I press "Save" (which does applyupdates and commitretaining) the program crashes with : TApplication.HandleException Access violation Stack trace: $08211A8E $0821AE3F TCUSTOMDBGRID__UPDATESCROLLBARRANGE, line 1336 of dbgrids.pas $0821B013 TCUSTOMDBGRID__DOLAYOUTCHANGED, line 1402 of dbgrids.pas $0821CB35 TCUSTOMDBGRID__ENDLAYOUT, line 2164 of dbgrids.pas $0821B660 TCUSTOMDBGRID__LAYOUTCHANGED, line 1568 of dbgrids.pas $08219DA2 TCUSTOMDBGRID__ONDATASETCHANGED, line 814 of dbgrids.pas $0821E518 TCOMPONENTDATALINK__DATASETCHANGED, line 2722 of dbgrids.pas $0820E0F4 $0820EEF5 $0820F10B $08202E6B $08205F5D $08211320 $08211264 $0807DE10 TFORMASIMPLA__ACTIONCOMMITEXECUTE, line 85 of forma_simpla.pas $0808DDB5 $081755F2 TCONTAINEDACTION__EXECUTE, line 110 of ./include/containedaction.inc In ContainedAction.inc: function TContainedAction.Execute: Boolean; begin Result := (ActionList nil) and ActionList.ExecuteAction(Self) or ((ApplicationActionComponentnil) and ApplicationActionComponent.ExecuteAction(Self)) or inherited Execute // <------------------------- line 110 or (SendApplicationMessage(CM_ACTIONEXECUTE, 0, PtrInt(Self)) = 1); end; Cheers, Adrian Maier _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives -- Howard Lee Harkness _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Howard Lee Harkness
to Joost van der Sluis

Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus 0.9.25 beta.

Seems to me that I should have been able to get a program as trivial as the one I am trying to write running with stuff that was available two years ago. Kinda makes me wonder if I'm just trying to use the wrong tools.

Joost van der Sluis wrote 124 lines
Op zaterdag 14-06-2008 om 19:16 uur [tijdzone -0500], schreef Howard Lee Harkness: > Did you ever get an answer to this question? I am having a similar > difficulty, and information on ApplyUpdates is infuriatingly hard to > find. You can find this problem in the bug-tracker. You can work around it with 'TDataset.DisableControls' and 'TDataset.Enablecontrols' around the applyupdates call. Or try fpc 2.2.2rc1 or any later version. Joost. > On Tue, Oct 10, 2006 at 1:11 AM, Adrian Maier > wrote: > On 10/10/06, Joost van der Sluis wrote: > > Well... As I read it, that's not the problem. All > changes are made in an > update-buffer first. So if you do a 'delete' in the > grid, the records > get deleted in that buffer. Thus the record should > disapear immediately > in the grid. But not yet on the database. > > The 'delete'-sql is only send to the database on > the .applyupdates > command. And committed on the .commitretaining. Thus > that can happen > much later. (on the click on the 'save' button) > > But if I understood you correctly, the delete fails > immediately. That > means that there's a problem in the deletion of > records in a grid. Or in > the .delete from Tbufdataset. You first have to test > that. Easiest way > is to add a button 'delete' which does > sqlquery1.delete. That'll delete > the current record, and it should be immediately > visible in the grid. > Else you could do a .refresh after the .delete, to be > sure that the grid > gets refreshed. (If not, it's a bug, btw) > > > I've added a button which calls query1.Delete. The row > disappears > from the grid now. So, it looks like TdbNavigator's > "Delete" button does > something different than it's supposed to do ? > > However, when I press "Save" (which does applyupdates and > commitretaining) > the program crashes with : > > TApplication.HandleException Access violation > Stack trace: > $08211A8E > $0821AE3F TCUSTOMDBGRID__UPDATESCROLLBARRANGE, line 1336 of > dbgrids.pas > $0821B013 TCUSTOMDBGRID__DOLAYOUTCHANGED, line 1402 of > dbgrids.pas > $0821CB35 TCUSTOMDBGRID__ENDLAYOUT, line 2164 of > dbgrids.pas > $0821B660 TCUSTOMDBGRID__LAYOUTCHANGED, line 1568 of > dbgrids.pas > $08219DA2 TCUSTOMDBGRID__ONDATASETCHANGED, line 814 of > dbgrids.pas > $0821E518 TCOMPONENTDATALINK__DATASETCHANGED, line 2722 of > dbgrids.pas > $0820E0F4 > $0820EEF5 > $0820F10B > $08202E6B > $08205F5D > $08211320 > $08211264 > $0807DE10 TFORMASIMPLA__ACTIONCOMMITEXECUTE, line 85 of > forma_simpla.pas > $0808DDB5 > $081755F2 TCONTAINEDACTION__EXECUTE, line 110 of > ./include/containedaction.inc > > In ContainedAction.inc: > > function TContainedAction.Execute: Boolean; > begin > Result := (ActionList nil) and > ActionList.ExecuteAction(Self) > or ((ApplicationActionComponentnil) > and ApplicationActionComponent.ExecuteAction(Self)) > or inherited Execute // > <------------------------- line 110 > or (SendApplicationMessage(CM_ACTIONEXECUTE, 0, > PtrInt(Self)) = 1); > end; > > > Cheers, > Adrian Maier > > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > > > > > -- > Howard Lee Harkness > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/a3334aee/attachment-0001.html

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness

2008/6/21 Howard Lee Harkness :

Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus 0.9.25 beta.

Nothing should prevent you from using Lazarus 0.9.24 with FPC 2.2.2rc1

Felipe Monteiro de Carvalho

Reply by email

Howard Lee Harkness
to Howard Lee Harkness: Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus…

Lazarus 9.25 beta (with FPC 2.2.2) does not appear to be ready for prime time. The first thing it did on my system was crash when I tried to close a project that partially loaded and quit due to not finding the ZeosLib components. Then, it failed to rebuild the IDE when I tried to install ZeosLib.

Guess I need to wait for the real release.

On Sat, Jun 21, 2008 at 5:05 PM, Howard Lee Harkness <

Show quoted text 144 lines
wrote: Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus 0.9.25 beta. Seems to me that I should have been able to get a program as trivial as the one I am trying to write running with stuff that was available two years ago. Kinda makes me wonder if I'm just trying to use the wrong tools. On Thu, Jun 19, 2008 at 8:25 AM, Joost van der Sluis wrote: > Op zaterdag 14-06-2008 om 19:16 uur [tijdzone -0500], schreef Howard Lee > Harkness: > > Did you ever get an answer to this question? I am having a similar > > difficulty, and information on ApplyUpdates is infuriatingly hard to > > find. > > You can find this problem in the bug-tracker. You can work around it > with 'TDataset.DisableControls' and 'TDataset.Enablecontrols' around the > applyupdates call. Or try fpc 2.2.2rc1 or any later version. > > Joost. > > > On Tue, Oct 10, 2006 at 1:11 AM, Adrian Maier > > wrote: > > On 10/10/06, Joost van der Sluis wrote: > > > > Well... As I read it, that's not the problem. All > > changes are made in an > > update-buffer first. So if you do a 'delete' in the > > grid, the records > > get deleted in that buffer. Thus the record should > > disapear immediately > > in the grid. But not yet on the database. > > > > The 'delete'-sql is only send to the database on > > the .applyupdates > > command. And committed on the .commitretaining. Thus > > that can happen > > much later. (on the click on the 'save' button) > > > > But if I understood you correctly, the delete fails > > immediately. That > > means that there's a problem in the deletion of > > records in a grid. Or in > > the .delete from Tbufdataset. You first have to test > > that. Easiest way > > is to add a button 'delete' which does > > sqlquery1.delete. That'll delete > > the current record, and it should be immediately > > visible in the grid. > > Else you could do a .refresh after the .delete, to be > > sure that the grid > > gets refreshed. (If not, it's a bug, btw) > > > > > > I've added a button which calls query1.Delete. The row > > disappears > > from the grid now. So, it looks like TdbNavigator's > > "Delete" button does > > something different than it's supposed to do ? > > > > However, when I press "Save" (which does applyupdates and > > commitretaining) > > the program crashes with : > > > > TApplication.HandleException Access violation > > Stack trace: > > $08211A8E > > $0821AE3F TCUSTOMDBGRID__UPDATESCROLLBARRANGE, line 1336 of > > dbgrids.pas > > $0821B013 TCUSTOMDBGRID__DOLAYOUTCHANGED, line 1402 of > > dbgrids.pas > > $0821CB35 TCUSTOMDBGRID__ENDLAYOUT, line 2164 of > > dbgrids.pas > > $0821B660 TCUSTOMDBGRID__LAYOUTCHANGED, line 1568 of > > dbgrids.pas > > $08219DA2 TCUSTOMDBGRID__ONDATASETCHANGED, line 814 of > > dbgrids.pas > > $0821E518 TCOMPONENTDATALINK__DATASETCHANGED, line 2722 of > > dbgrids.pas > > $0820E0F4 > > $0820EEF5 > > $0820F10B > > $08202E6B > > $08205F5D > > $08211320 > > $08211264 > > $0807DE10 TFORMASIMPLA__ACTIONCOMMITEXECUTE, line 85 of > > forma_simpla.pas > > $0808DDB5 > > $081755F2 TCONTAINEDACTION__EXECUTE, line 110 of > > ./include/containedaction.inc > > > > In ContainedAction.inc: > > > > function TContainedAction.Execute: Boolean; > > begin > > Result := (ActionList nil) and > > ActionList.ExecuteAction(Self) > > or ((ApplicationActionComponentnil) > > and ApplicationActionComponent.ExecuteAction(Self)) > > or inherited Execute // > > <------------------------- line 110 > > or (SendApplicationMessage(CM_ACTIONEXECUTE, 0, > > PtrInt(Self)) = 1); > > end; > > > > > > Cheers, > > Adrian Maier > > > > > > > > > _________________________________________________________________ > > To unsubscribe: mail with > > "unsubscribe" as the Subject > > archives at http://www.lazarus.freepascal.org/mailarchives > > > > > > > > > > -- > > Howard Lee Harkness > > _______________________________________________ > > Lazarus mailing list > > > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > -- > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > -- Howard Lee Harkness
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/1a064c29/attachment.html

Reply by email

Howard Lee Harkness
to Felipe Monteiro de Carvalho: 2008/6/21 Howard Lee Harkness : Nothing should prevent you from using Lazarus 0.9.24 with…

Hmmm... I couldn't seem to find everything for the environmental setups in 9.24, but I guess I can try again.

On Sat, Jun 21, 2008 at 5:15 PM, Felipe Monteiro de Carvalho <

Show quoted text 15 lines
wrote: 2008/6/21 Howard Lee Harkness : > Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to > install Lazarus 0.9.25 beta. Nothing should prevent you from using Lazarus 0.9.24 with FPC 2.2.2rc1 -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/45c2a36f/attachment-0001.html

Reply by email

Howard Lee Harkness
to Felipe Monteiro de Carvalho: 2008/6/21 Howard Lee Harkness : Nothing should prevent you from using Lazarus 0.9.24 with…

I think I have spent about 10 times the effort that I thought it would take to write the trivial application just trying to configure Lazarus.

On Sat, Jun 21, 2008 at 5:15 PM, Felipe Monteiro de Carvalho <

Show quoted text 15 lines
wrote: 2008/6/21 Howard Lee Harkness : > Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to > install Lazarus 0.9.25 beta. Nothing should prevent you from using Lazarus 0.9.24 with FPC 2.2.2rc1 -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/38b39bcc/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness: Lazarus 9.25 beta (with FPC 2.2.2) does not appear to be ready for prime time. The first…

2008/6/21 Howard Lee Harkness :

Show quoted text 5 lines
Lazarus 9.25 beta (with FPC 2.2.2) does not appear to be ready for prime time. The first thing it did on my system was crash when I tried to close a project that partially loaded and quit due to not finding the ZeosLib components. Then, it failed to rebuild the IDE when I tried to install ZeosLib.

You have had a very bad timing =)

Marc commited today a very large change in the bitmap subsystem which made the Lazarus IDE stop working. I hope this will be fixed in the next days.

From the last months until yesterday Lazarus 0.9.25 was working

perfectly (at least for me and on Windows, Windows CE, Linux-Gtk2 and Mac OS X native Carbon).

Anyway, under development version are like this. That's why I hope to see FPC 2.2.2 release as soon as possible so that we can also release Lazarus 0.9.26 as soon as possible.

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness: Hmmm... I couldn't seem to find everything for the environmental setups in 9.24, but I…
I think I have spent about 10 times the effort that I thought it would take to write the trivial application just trying to configure Lazarus.

2008/6/21 Howard Lee Harkness :

Hmmm... I couldn't seem to find everything for the environmental setups in 9.24, but I guess I can try again.

You should do the following to set Lazarus 0.9.24 with FPC 2.2.2rc1

I will supposed you used the standard windows installer which also installs FPC for Lazarus 0.9.24 and you used a stand alone FPC only installer for FPC 2.2.2rc1

Go to the Environment options dialog and change the compiler and make paths to the 2.2.2rc1 compiler

Go to Tools --> Configure build lazarus

Go to the advanced page

Set everything to None and LCL to Clean+Build.

Click the Build button.

If LCL compiled successfully you are all set.

As you see, you don't need to rebuild the entire IDE, just LCL and this is good, because then you don't risk the stability of your IDE and it is quicker to just build LCL.

Felipe Monteiro de Carvalho

Reply by email

Howard Lee Harkness
to Howard Lee Harkness: I think I have spent about 10 times the effort that I thought it would take to write the…

Looks like all of the 2.2.2rc1 sources are zipped up separately by unit. Any hints about where/how to put them in the directory structure so that Lazarus can find them in the environment settings????

On Sat, Jun 21, 2008 at 5:33 PM, Howard Lee Harkness <

Show quoted text 28 lines
wrote: I think I have spent about 10 times the effort that I thought it would take to write the trivial application just trying to configure Lazarus. On Sat, Jun 21, 2008 at 5:15 PM, Felipe Monteiro de Carvalho < > wrote: > 2008/6/21 Howard Lee Harkness : > > Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have > to > > install Lazarus 0.9.25 beta. > > Nothing should prevent you from using Lazarus 0.9.24 with FPC 2.2.2rc1 > > -- > Felipe Monteiro de Carvalho > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > -- Howard Lee Harkness
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/92233637/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness

2008/6/21 Howard Lee Harkness :

Looks like all of the 2.2.2rc1 sources are zipped up separately by unit. Any hints about where/how to put them in the directory structure so that Lazarus can find them in the environment settings????

Just download the installer from here and install it:

ftp://ftp.freepascal.org/fpc/beta/2.2.2rc1/i386-win32

You probably won't need to download the source. You can leave Lazarus using the source code from Free Pascal 2.2.0 which is installed with it. I do this and never had problems. The source is only used for some code completion, so the changes in the new version can probably be ignored.

You don't have to install FPC to anywhere special, just use a directory without spaces and inform where the fpc.exe executable is in the Environmental Options.

Felipe Monteiro de Carvalho

Reply by email

Howard Lee Harkness
to Felipe Monteiro de Carvalho: 2008/6/21 Howard Lee Harkness : You should do the following to set Lazarus 0.9.24 with…

At this step: Go to Tools --> Configure build lazarus I get the error: Fatal: Can't find unit system used by AllLCLUnits

On Sat, Jun 21, 2008 at 5:48 PM, Felipe Monteiro de Carvalho <

Show quoted text 41 lines
wrote: > I think I have spent about 10 times the effort that I thought it would take to write the trivial > application just trying to configure Lazarus. 2008/6/21 Howard Lee Harkness : > Hmmm... I couldn't seem to find everything for the environmental setups in > 9.24, but I guess I can try again. You should do the following to set Lazarus 0.9.24 with FPC 2.2.2rc1 I will supposed you used the standard windows installer which also installs FPC for Lazarus 0.9.24 and you used a stand alone FPC only installer for FPC 2.2.2rc1 Go to the Environment options dialog and change the compiler and make paths to the 2.2.2rc1 compiler Go to Tools --> Configure build lazarus Go to the advanced page Set everything to None and LCL to Clean+Build. Click the Build button. If LCL compiled successfully you are all set. As you see, you don't need to rebuild the entire IDE, just LCL and this is good, because then you don't risk the stability of your IDE and it is quicker to just build LCL. -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/f592fa0d/attachment-0001.html

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness

2008/6/21 Howard Lee Harkness :

At this step: Go to Tools --> Configure build lazarus I get the error: Fatal: Can't find unit system used by AllLCLUnits

Where did you install fpc 2.2.2rc1?

What did you put in the Environment options for the compiler and make?

Felipe Monteiro de Carvalho

Reply by email

Howard Lee Harkness
to Felipe Monteiro de Carvalho: 2008/6/21 Howard Lee Harkness : Just download the installer from here and install it:…

At this step: Go to Tools --> Configure build lazarus I get the error: Fatal: Can't find unit system used by AllLCLUnits

At least I was able to get 2.2.0 to restore. However, I'm back where I was before: A trivial 1-hour project has taken nearly 20 hours over a period of 3 weeks, and I haven't got anything to show for that effort. I'm tired of this.

All I want to do is make a little demo project that accesses a MySQL 5.0 database, and can insert, edit, and delete rows in a table. That's something I have done in less than 30 minutes using Delphi 3.0 over a decade ago (including the time it took to boot the computer). All I'm getting from Lazarus is a feeling that I'm too stupid to write database software anymore.

I see you have written another reply. I installed FPC 2.2.2rc1 in c:\lazarus\fpc\2.2.2rc1

I pointed the compiler environment settings as follows:

compiler: C:\lazarus\fpc\2.2.2rc1\bin\i386-win32\fpc.exe make: C:\lazarus\fpc\2.2.2rc1\bin\i386-win32\make.exe

At this point, it won't do anything useful at all, including the LCL rebuild, so I've gone back to 2.2.0, which at least seems to work for trivial non-database programs. I have also exhausted all of the time I had to work on this for the week, so I think I'll stop by Fry's on the way home from work sometime next week and buy a copy of Visual Basic. Bet it won't take me 20 hours to write a trivial DB app in VB.

On Sat, Jun 21, 2008 at 5:12 PM, Felipe Monteiro de Carvalho <

Show quoted text 30 lines
wrote: 2008/6/21 Howard Lee Harkness : > Looks like all of the 2.2.2rc1 sources are zipped up separately by unit. Any > hints about where/how to put them in the directory structure so that Lazarus > can find them in the environment settings???? Just download the installer from here and install it: ftp://ftp.freepascal.org/fpc/beta/2.2.2rc1/i386-win32 You probably won't need to download the source. You can leave Lazarus using the source code from Free Pascal 2.2.0 which is installed with it. I do this and never had problems. The source is only used for some code completion, so the changes in the new version can probably be ignored. You don't have to install FPC to anywhere special, just use a directory without spaces and inform where the fpc.exe executable is in the Environmental Options. -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/d97f1a17/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness

2008/6/21 Howard Lee Harkness :

At this step: Go to Tools --> Configure build lazarus I get the error: Fatal: Can't find unit system used by AllLCLUnits

I just tested here and it works for me. I don't know what is different. Maybe you unchecked "create default configuration file" in the fpc installer.

Are you using Windows XP too?

At least I was able to get 2.2.0 to restore. However, I'm back where I was before: A trivial 1-hour project has taken nearly 20 hours over a period of 3 weeks, and I haven't got anything to show for that effort. I'm tired of this.

If you focus in the positive side, you learned a lot about how to configure lazarus =)

Also, the original answer by Joost was:

"You can find this problem in the bug-tracker. You can work around it with 'TDataset.DisableControls' and 'TDataset.Enablecontrols' around the applyupdates call. Or try fpc 2.2.2rc1 or any later version."

So instead of trying to configure Lazarus with FPC 2.2.2rc1 you coul just have used TDataset.DisableControls ...

to work on this for the week, so I think I'll stop by Fry's on the way home from work sometime next week and buy a copy of Visual Basic. Bet it won't take me 20 hours to write a trivial DB app in VB.

It surely won't be cross-platform, nor will it support unicode =P Also it's probably a bad choice, as VB will probably wish that you use Access instead of MySQL (unless you don't care about which database to use).

But I do agree that Lazarus needs to improve when it comes to developing database aware applications.

With the money from VB you could pay someone to fix all problems with lazarus database apps connecting to mysql =P

I would go as far as saying that the only case in which I would recommend for someone to use Delphi instead of Lazarus is if he is developing Windows-only data-aware applications and he doesn't need any of the other features of Lazarus (like being open source, supporting unicode, etc).

Felipe Monteiro de Carvalho

Reply by email

Howard Lee Harkness
to Felipe Monteiro de Carvalho

Yes, I'm using XP Pro SP2.

Knowing how to configure Lazarus is not useful unless I can write a program that works using it.

I went back and checked to see if maybe I did the FPC installation without the default configuration file. Nope. It is checked by default, and I didn't change it. This time, I went through the readme and verified that I could build and run the Hello, World program. I was careful to install it directly to the directory where Lazarus would find it.

This time, I got a different error on the LCL build: Error: Identifier not found "LowerCaseTable".

That's it for tonight. Since my time is worth more than minimum wage, Lazarus is getting too expensive. I don't like admitting to defeat, but this one has defeated me.

I think I might have an old copy of D2, D3 or D4 somewhere... and maybe even a copy of D6. I know that I can make any of those do what I want, even if I have to go back to using the old BDE.

No, I don't care what database is underneath. No, I don't care if it's cross-platform. No, I don't even care what language it's written in (I am familiar with over a dozen), as long as I can make the app work. And if it can't be made to work, it doesn't matter what the database is, or whether it's cross-platform, or even what the language is. The ONLY thing that matters to a working programmer is whether the stuff he writes WORKS.

On Sat, Jun 21, 2008 at 7:26 PM, Felipe Monteiro de Carvalho <

Show quoted text 60 lines
wrote: 2008/6/21 Howard Lee Harkness : > At this step: Go to Tools --> Configure build lazarus > I get the error: Fatal: Can't find unit system used by AllLCLUnits I just tested here and it works for me. I don't know what is different. Maybe you unchecked "create default configuration file" in the fpc installer. Are you using Windows XP too? > At least I was able to get 2.2.0 to restore. However, I'm back where I was > before: A trivial 1-hour project has taken nearly 20 hours over a period of > 3 weeks, and I haven't got anything to show for that effort. I'm tired of > this. If you focus in the positive side, you learned a lot about how to configure lazarus =) Also, the original answer by Joost was: "You can find this problem in the bug-tracker. You can work around it with 'TDataset.DisableControls' and 'TDataset.Enablecontrols' around the applyupdates call. Or try fpc 2.2.2rc1 or any later version." So instead of trying to configure Lazarus with FPC 2.2.2rc1 you coul just have used TDataset.DisableControls ... > to work on this for the week, so I think I'll stop by Fry's on the way home > from work sometime next week and buy a copy of Visual Basic. Bet it won't > take me 20 hours to write a trivial DB app in VB. It surely won't be cross-platform, nor will it support unicode =P Also it's probably a bad choice, as VB will probably wish that you use Access instead of MySQL (unless you don't care about which database to use). But I do agree that Lazarus needs to improve when it comes to developing database aware applications. With the money from VB you could pay someone to fix all problems with lazarus database apps connecting to mysql =P I would go as far as saying that the only case in which I would recommend for someone to use Delphi instead of Lazarus is if he is developing Windows-only data-aware applications and he doesn't need any of the other features of Lazarus (like being open source, supporting unicode, etc). -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/cfbd7ae8/attachment-0001.html

Reply by email

Howard Lee Harkness
to Howard Lee Harkness

Well, I couldn't just give up, I had to try ONE MORE THING.

So, I put in the following code:

procedure TForm1.DBNavigator1Click(Sender: TObject; Button:
TDBNavButtonType);
begin
  case Button of
  nbPost: begin
          SQLQuery1.DisableControls;
          SQLQuery1.ApplyUpdates;
          SQLQuery1.EnableControls;
          end;
  nbRefresh: begin
             SQLQuery1.Close;
             SQLQuery1.Open;
             end;
  end;
end;

At that point, I could insert a record, but not edit or delete a record. So, I tried the following:

procedure TForm1.DBNavigator1Click(Sender: TObject; Button:
TDBNavButtonType);
begin
  case Button of
  nbDelete,
  nbPost: begin
          SQLQuery1.DisableControls;
          SQLQuery1.ApplyUpdates;
          SQLQuery1.EnableControls;
          end;
  nbRefresh: begin
             SQLQuery1.Close;
             SQLQuery1.Open;
             end;
  end;
end;

Lo, and behold! I could now insert a record, and delete a record!!! Elated, I tried the following:

procedure TForm1.DBNavigator1Click(Sender: TObject; Button:
TDBNavButtonType);
begin
  case Button of
  nbDelete, nbEdit,
  nbPost: begin
          SQLQuery1.DisableControls;
          SQLQuery1.ApplyUpdates;
          SQLQuery1.EnableControls;
          end;
  nbRefresh: begin
             SQLQuery1.Close;
             SQLQuery1.Open;
             end;
  end;
end;

Alas, no joy. I can insert and delete a record, but I still can't edit a record.

I don't know if I can send attachments to this list, but if I can, the source for the trivial application is attached.

The schema for the table I'm using is:

CREATE TABLE IF NOT EXISTS ZIPCODE
(
ZIPID INT NOT NULL AUTO_INCREMENT,
ZIP VARCHAR(5) NOT NULL,
ZIPEXT VARCHAR(4),
CITY VARCHAR(40),
STATE VARCHAR(2),
PRIMARY KEY(ZIPID)
);
INSERT INTO ZIPCODE (ZIP,ZIPEXT,CITY,STATE) VALUES ('01814',NULL,'Lawrence','MA')
,('13502',NULL,'Utica','NY')
,('22030',NULL,'Fairfax','VA')
,('27030',NULL,'Mt. Airy','NC')
,('27103',NULL,'Winston-Salem','NC')
,('27104',NULL,'Winston-salem','NC')
,('27106',NULL,'Winston-Salem','NC')
,('30084',NULL,'Tucker','GA')
;

On Sat, Jun 21, 2008 at 7:35 PM, Howard Lee Harkness <

Show quoted text 101 lines
wrote: Yes, I'm using XP Pro SP2. Knowing how to configure Lazarus is not useful unless I can write a program that works using it. I went back and checked to see if maybe I did the FPC installation without the default configuration file. Nope. It is checked by default, and I didn't change it. This time, I went through the readme and verified that I could build and run the Hello, World program. I was careful to install it directly to the directory where Lazarus would find it. This time, I got a different error on the LCL build: Error: Identifier not found "LowerCaseTable". That's it for tonight. Since my time is worth more than minimum wage, Lazarus is getting too expensive. I don't like admitting to defeat, but this one has defeated me. I think I might have an old copy of D2, D3 or D4 somewhere... and maybe even a copy of D6. I know that I can make any of those do what I want, even if I have to go back to using the old BDE. No, I don't care what database is underneath. No, I don't care if it's cross-platform. No, I don't even care what language it's written in (I am familiar with over a dozen), as long as I can make the app work. And if it can't be made to work, it doesn't matter what the database is, or whether it's cross-platform, or even what the language is. The ONLY thing that matters to a working programmer is whether the stuff he writes WORKS. On Sat, Jun 21, 2008 at 7:26 PM, Felipe Monteiro de Carvalho < > wrote: > 2008/6/21 Howard Lee Harkness : > > At this step: Go to Tools --> Configure build lazarus > > I get the error: Fatal: Can't find unit system used by AllLCLUnits > > I just tested here and it works for me. I don't know what is > different. Maybe you unchecked "create default configuration file" in > the fpc installer. > > Are you using Windows XP too? > > > At least I was able to get 2.2.0 to restore. However, I'm back where I > was > > before: A trivial 1-hour project has taken nearly 20 hours over a period > of > > 3 weeks, and I haven't got anything to show for that effort. I'm tired > of > > this. > > If you focus in the positive side, you learned a lot about how to > configure lazarus =) > > Also, the original answer by Joost was: > > "You can find this problem in the bug-tracker. You can work around it > with 'TDataset.DisableControls' and 'TDataset.Enablecontrols' around the > applyupdates call. Or try fpc 2.2.2rc1 or any later version." > > So instead of trying to configure Lazarus with FPC 2.2.2rc1 you coul > just have used TDataset.DisableControls ... > > > to work on this for the week, so I think I'll stop by Fry's on the way > home > > from work sometime next week and buy a copy of Visual Basic. Bet it > won't > > take me 20 hours to write a trivial DB app in VB. > > It surely won't be cross-platform, nor will it support unicode =P Also > it's probably a bad choice, as VB will probably wish that you use > Access instead of MySQL (unless you don't care about which database to > use). > > But I do agree that Lazarus needs to improve when it comes to > developing database aware applications. > > With the money from VB you could pay someone to fix all problems with > lazarus database apps connecting to mysql =P > > I would go as far as saying that the only case in which I would > recommend for someone to use Delphi instead of Lazarus is if he is > developing Windows-only data-aware applications and he doesn't need > any of the other features of Lazarus (like being open source, > supporting unicode, etc). > > -- > Felipe Monteiro de Carvalho > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > -- Howard Lee Harkness
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/a2ac1e81/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: zipform.pas Type: application/octet-stream Size: 1267 bytes Desc: not available Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/a2ac1e81/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: zipform.lfm Type: application/octet-stream Size: 1695 bytes Desc: not available Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/a2ac1e81/attachment-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: zipproject.lpr Type: application/octet-stream Size: 342 bytes Desc: not available Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/a2ac1e81/attachment-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: zipproject.lpi Type: application/octet-stream Size: 4171 bytes Desc: not available Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080621/a2ac1e81/attachment-0003.obj

Reply by email

Felipe Monteiro de Carvalho
to Howard Lee Harkness: Yes, I'm using XP Pro SP2. Knowing how to configure Lazarus is not useful unless I can…

2008/6/21 Howard Lee Harkness :

No, I don't care what database is underneath.

Well .... so I think that you made a bad choice starting with a more complex dataset (MySQL) with a known problem. I had supposed that you needed to use MySQL.

I would recommend that you start with TDBF instead. I'm 100% sure this one works.

http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial

Felipe Monteiro de Carvalho

Reply by email

Martin Schreiber
to Howard Lee Harkness: Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus…
Howard Lee Harkness wrote 7 lines
Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus 0.9.25 beta. Seems to me that I should have been able to get a program as trivial as the one I am trying to write running with stuff that was available two years ago. Kinda makes me wonder if I'm just trying to use the wrong tools.

There is also MSEide+MSEgui which is well suited to build Free Pascal database applications on Linux and win32. It is currently on revision 1.8rc1 and used in production. It works with FPC 2.2 and 2.2.2rc1.

http://sourceforge.net/projects/mseide-msegui

Installation guidelines:
http://homepage.bluewin.ch/msegui/

Newsgroup (NNTP):
news://news.grid-sky.com/public.mseide-msegui.talk

Martin

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho: 2008/6/21 Howard Lee Harkness : Nothing should prevent you from using Lazarus 0.9.24 with…
Felipe Monteiro de Carvalho wrote 6 lines
2008/6/21 Howard Lee Harkness : > Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to > install Lazarus 0.9.25 beta. Nothing should prevent you from using Lazarus 0.9.24 with FPC 2.2.2rc1

I did not test it, but I think you cannot compiler an older Lazarus with a newer fpc version. See the svn logs since Lazarus 0.9.24 for commit messages like 'fixed compilation for fpc 2.3.1'. If those changes in fpc 2.3.1 are merged to fpc 2.2.1, which is not unreasonable, that you will need those fixes made in Lazarus 0.9.25 to compile with fpc 2.2.2rc1.

Vincent

Reply by email

Joost van der Sluis
to Howard Lee Harkness: Guess I'll try 2.2.2rc1, but it looks like in order to do that, I have to install Lazarus…

Op zaterdag 21-06-2008 om 17:05 uur [tijdzone -0500], schreef Howard Lee Harkness:

Show quoted text 5 lines
Seems to me that I should have been able to get a program as trivial as the one I am trying to write running with stuff that was available two years ago. Kinda makes me wonder if I'm just trying to use the wrong tools.

Yes, you are. You are using MySQL for a non-web-based application. ;)

Joost.

Reply by email

Joost van der Sluis
to Howard Lee Harkness: Well, I couldn't just give up, I had to try ONE MORE THING. So, I put in the following…

Op zaterdag 21-06-2008 om 20:06 uur [tijdzone -0600], schreef Howard Lee Harkness:

Show quoted text 22 lines
At that point, I could insert a record, but not edit or delete a record. So, I tried the following: procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TDBNavButtonType); begin case Button of nbDelete, nbPost: begin SQLQuery1.DisableControls; SQLQuery1.ApplyUpdates; SQLQuery1.EnableControls; end; nbRefresh: begin SQLQuery1.Close; SQLQuery1.Open; end; end; end; Lo, and behold! I could now insert a record, and delete a record!!! Elated, I tried the following:

My question is why you did DBNavigator1Click at all? On nbPost, it should call - first of all - SQLQuery1.Post. You forgot that. (I guess that that's your edit-problem) Normally, if you don't implement DBNavigator1Click it will do that automatically.

If you want the changed to be committed to the underlying database immediately (Is that a good design?) then you can add the disable-apply-enable sequence to the SQLQuery1.AfterScroll event. Then you don't need the DBNavigator1Click-hack.

Joost

Reply by email

Howard Lee Harkness
to Joost van der Sluis
Joost van der Sluis wrote 6 lines
My question is why you did DBNavigator1Click at all? On nbPost, it should call - first of all - SQLQuery1.Post. You forgot that. (I guess that that's your edit-problem) Normally, if you don't implement DBNavigator1Click it will do that automatically. Well, without some place to put the ApplyUpdates call, nothing gets changed

in the database. When I tried not implementing the DBNavigator1Click, the program appeared to be working, but the database never actually changed.

I also tried putting the ApplyUpdates in the FormClose event, and that didn't do anything, either.

You are the one that mentioned that I needed to call ApplyUpdates (and later, disable and enable controls). Could you please take a look at the code I posted and SHOW ME what I need to do to make this work?

Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080622/e497441d/attachment.html

Reply by email

Howard Lee Harkness
to Howard Lee Harkness

Oh, and I *don't* want to applyupdates on the AfterScroll event unless that is the only choice.

On Sun, Jun 22, 2008 at 2:22 PM, Howard Lee Harkness <

Show quoted text 24 lines
wrote: On Sun, Jun 22, 2008 at 9:03 AM, Joost van der Sluis wrote: > My question is why you did DBNavigator1Click at all? On nbPost, it > should call - first of all - SQLQuery1.Post. You forgot that. (I guess > that that's your edit-problem) Normally, if you don't implement > DBNavigator1Click it will do that automatically. > > Well, without some place to put the ApplyUpdates call, nothing gets changed in the database. When I tried not implementing the DBNavigator1Click, the program appeared to be working, but the database never actually changed. I also tried putting the ApplyUpdates in the FormClose event, and that didn't do anything, either. You are the one that mentioned that I needed to call ApplyUpdates (and later, disable and enable controls). Could you please take a look at the code I posted and SHOW ME what I need to do to make this work? -- Howard Lee Harkness
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080622/7af6df83/attachment.html

Reply by email

Howard Lee Harkness
to Felipe Monteiro de Carvalho: 2008/6/21 Howard Lee Harkness : Well .... so I think that you made a bad choice starting…

Hmmm... looks like TDBF doesn't have any way to load my tables without writing yet another program. And dBase tables? I think I will check out SQLite first. I picked on MySQL by recommendation from some folks telling me how it was a mature db with all of the features I was used to from working with Oracle. It was certainly easier to set up than FireBird -- and better documented.

I suppose also that I could write all of the insert/delete/edit code, but I didn't have to do that in Delphi 10 years ago. The DbNavigator just worked with no additional Sat, Jun 21, 2008 at 9:21 PM, Felipe Monteiro de Carvalho <

Show quoted text 21 lines
wrote: 2008/6/21 Howard Lee Harkness : > No, I don't care what database is underneath. Well .... so I think that you made a bad choice starting with a more complex dataset (MySQL) with a known problem. I had supposed that you needed to use MySQL. I would recommend that you start with TDBF instead. I'm 100% sure this one works. http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080622/f3e99325/attachment-0001.html

Reply by email

Howard Lee Harkness
to Howard Lee Harkness: in the database. When I tried not implementing the DBNavigator1Click, the program…

Ok I added the Post call (for some reason, I thought the DbNavigator did that automatically, but apparently not if you implement the click handler. So now I have:

procedure TForm1.DBNavigator1Click(Sender: TObject; Button:
TDBNavButtonType);
begin
  case Button of
  nbEdit: begin
          SQLQuery1.Edit;
          end;
  nbPost: begin
          SQLQuery1.Post;
          SQLQuery1.DisableControls;
          SQLQuery1.ApplyUpdates;
          SQLQuery1.EnableControls;
          end;
  nbRefresh: begin
             SQLQuery1.Close;
             SQLQuery1.Open;
             end;
  end;
end;

Inch by incredible inch. I can now insert and delete, but edit still does nothing, even though it appears to until I stop and restart the program.

On Sun, Jun 22, 2008 at 1:22 PM, Howard Lee Harkness <

Show quoted text 24 lines
wrote: On Sun, Jun 22, 2008 at 9:03 AM, Joost van der Sluis wrote: > My question is why you did DBNavigator1Click at all? On nbPost, it > should call - first of all - SQLQuery1.Post. You forgot that. (I guess > that that's your edit-problem) Normally, if you don't implement > DBNavigator1Click it will do that automatically. > > Well, without some place to put the ApplyUpdates call, nothing gets changed in the database. When I tried not implementing the DBNavigator1Click, the program appeared to be working, but the database never actually changed. I also tried putting the ApplyUpdates in the FormClose event, and that didn't do anything, either. You are the one that mentioned that I needed to call ApplyUpdates (and later, disable and enable controls). Could you please take a look at the code I posted and SHOW ME what I need to do to make this work? -- Howard Lee Harkness
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080622/3d9dd748/attachment.html

Reply by email

Jesus Reyes
to Howard Lee Harkness: in the database. When I tried not implementing the DBNavigator1Click, the program…
Show quoted text 14 lines
I also tried putting the ApplyUpdates in the FormClose event, and that didn't do anything, either. You are the one that mentioned that I needed to call ApplyUpdates (and later, disable and enable controls). Could you please take a look at the code I posted and SHOW ME what I need to do to make this work? -- Howard Lee Harkness

Most TDataset components have one OnAfterPost event, if the intent is commit changes as soon as they get posted this might help.

Jesus Reyes A.

____________________________________________________________________________________ Yahoo! Deportes Beta
?No te pierdas lo ?ltimo sobre el torneo clausura 2008! Ent?rate aqu? http://deportes.yahoo.com

Reply by email

John
to Howard Lee Harkness: Hmmm... looks like TDBF doesn't have any way to load my tables without writing yet…
Howard Lee Harkness wrote 11 lines
Hmmm... looks like TDBF doesn't have any way to load my tables without writing yet another program. And dBase tables? I think I will check out SQLite first. I picked on MySQL by recommendation from some folks telling me how it was a mature db with all of the features I was used to from working with Oracle. It was certainly easier to set up than FireBird -- and better documented. I suppose also that I could write all of the insert/delete/edit code, but I didn't have to do that in Delphi 10 years ago. The DbNavigator just worked with no additional code at all.

If you come from an Oracle background, consider Postgresql. I had an Oracle background too, and felt immediately at home with PG. On the other hand, dBase tables work fine for simple, single user tables, with less fuss than SQL. It depends on what you are trying to do.

I admit I always use an external tool to build the tables. In postresql, pgadmin; for dbase tables an old copy of DBase it self (yes, I have one!) or DBD from Dephi.

Also, since I am writing, in looking through your last example or two, there doesn't seem to be any transaction.commit ? This is needed in PG, I presume in MySQL as well.

My basic test database program had a PQConnection, SQLTranaction, SQLQuery (select * from ...), and the usual set of data-aware controls - grid, navigator, edit fields, etc - connected to the query, all set up at design time as you would in Delphi. The only code was in a 'commit' button:

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  SQLQuery1.ApplyUpdates;
  SQLTransaction1.CommitRetaining;
end;

cheers,
John Sunderland

Reply by email

Howard Lee Harkness
to John

Interesting... I tried your approach with MySQL, and I still could not get edit to work. It appears to work in the grid, but stopping and re-starting the program showed that nothing actually got edited.

Looks like I need to take your advice and try Postgresql. However, I won't have any significant time to work on this project until next Sunday. Bummer. I still have the vague suspicion that the problem is not with MySQL, but with the TNavigator component. But if MySQL simply won't work with Lazarus, it just won't work, and I don't need to spend the rest of the year running into the same brick wall.

This is not the only project I have in mind, of course. It's just the first step in a much larger project, for which I would like to make some money. So the real solution may still be to actually buy some commercial development tools. I really wanted to make a go of using all open-source stuff, but first I need to find something that is ready for prime time.

Until I can write a trivial program that displays, inserts, deletes, and edits records in a simple database table, I have no hope whatever of getting any farther. So far, I have not seen any evidence that this is even possible using Lazarus and MySQL (without writing 1000 lines of code to do all of the SQL manipulation), so the next step is to evaluate another set of tools.

What I REALLY wanted was to be able to drop some components on a form (connection, query, datasource, dbgrid, and dbnavigator), and link them together with some properties, and have it work without writing a lick of code -- just like I once did with Delphi 3 over a decade ago. So far, Lazarus has not caught up with D3, much less D6.

Hmm... I need to spend some time looking for my old copy of D3 and see if it will even run on XP.

John wrote 44 lines
Howard Lee Harkness wrote: > Hmmm... looks like TDBF doesn't have any way to load my tables without > writing yet another program. And dBase tables? I think I will check > out SQLite first. I picked on MySQL by recommendation from some folks > telling me how it was a mature db with all of the features I was used > to from working with Oracle. It was certainly easier to set up than > FireBird -- and better documented. > > I suppose also that I could write all of the insert/delete/edit code, > but I didn't have to do that in Delphi 10 years ago. The DbNavigator > just worked with no additional code at all. > If you come from an Oracle background, consider Postgresql. I had an Oracle background too, and felt immediately at home with PG. On the other hand, dBase tables work fine for simple, single user tables, with less fuss than SQL. It depends on what you are trying to do. I admit I always use an external tool to build the tables. In postresql, pgadmin; for dbase tables an old copy of DBase it self (yes, I have one!) or DBD from Dephi. Also, since I am writing, in looking through your last example or two, there doesn't seem to be any transaction.commit ? This is needed in PG, I presume in MySQL as well. My basic test database program had a PQConnection, SQLTranaction, SQLQuery (select * from ...), and the usual set of data-aware controls - grid, navigator, edit fields, etc - connected to the query, all set up at design time as you would in Delphi. The only code was in a 'commit' button: procedure TForm1.BitBtn1Click(Sender: TObject); begin SQLQuery1.ApplyUpdates; SQLTransaction1.CommitRetaining; end; cheers, John Sunderland _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080622/cf51d8ec/attachment.html

Reply by email

John
to Howard Lee Harkness
Howard Lee Harkness wrote 10 lines
Interesting... I tried your approach with MySQL, and I still could not get edit to work. It appears to work in the grid, but stopping and re-starting the program showed that nothing actually got edited. Looks like I need to take your advice and try Postgresql. However, I won't have any significant time to work on this project until next Sunday. Bummer. I still have the vague suspicion that the problem is not with MySQL, but with the TNavigator component. But if MySQL simply won't work with Lazarus, it just won't work, and I don't need to spend the rest of the year running into the same brick wall.

I am not saying that MySQL won't work, rather that Postgres has a similar 'feel' to using Oracle. All the concepts are similar. On the other hand, while I have never tried MySql, just from perusing this list, it does seem to have more problems with library versions, etc.

Show quoted text 14 lines
This is not the only project I have in mind, of course. It's just the first step in a much larger project, for which I would like to make some money. So the real solution may still be to actually buy some commercial development tools. I really wanted to make a go of using all open-source stuff, but first I need to find something that is ready for prime time. Until I can write a trivial program that displays, inserts, deletes, and edits records in a simple database table, I have no hope whatever of getting any farther. So far, I have not seen any evidence that this is even possible using Lazarus and MySQL (without writing 1000 lines of code to do all of the SQL manipulation), so the next step is to evaluate another set of tools.

It probably really is worth satisfying yourself that you can do this with a dbase (or other local) table first - it does work.

Show quoted text 6 lines
What I REALLY wanted was to be able to drop some components on a form (connection, query, datasource, dbgrid, and dbnavigator), and link them together with some properties, and have it work without writing a lick of code -- just like I once did with Delphi 3 over a decade ago. So far, Lazarus has not caught up with D3, much less D6.

To be fair, while you could do what you are saying with simple stuff into local (dbase/paradox) tables, I can't ever remember being able to do that in 'Real World' applications using Delphi 4 C/S into Oracle, of which I did quite a bit.

Hmm... I need to spend some time looking for my old copy of D3 and see if it will even run on XP.

It will - I even have Delphi 1 running on XP (don't ask why !) as well as using D4 extensively on it, due to some applications that use paradox dbs.

(snip)

Cheers,
John Sunderland

Reply by email

Luca Olivetti
to Howard Lee Harkness: Interesting... I tried your approach with MySQL, and I still could not get edit to work.…

En/na Howard Lee Harkness ha escrit:

Show quoted text 5 lines
What I REALLY wanted was to be able to drop some components on a form (connection, query, datasource, dbgrid, and dbnavigator), and link them together with some properties, and have it work without writing a lick of code -- just like I once did with Delphi 3 over a decade ago. So far, Lazarus has not caught up with D3, much less D6.

Mmmh, I have it working as you say with sqlite and the zeos components (and IIRC I suggested that to you a while ago).

Bye

Luca -- Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007

Reply by email

Joost van der Sluis
to Howard Lee Harkness: Interesting... I tried your approach with MySQL, and I still could not get edit to work.…

Op zondag 22-06-2008 om 19:34 uur [tijdzone -0600], schreef Howard Lee Harkness:

Show quoted text 6 lines
What I REALLY wanted was to be able to drop some components on a form (connection, query, datasource, dbgrid, and dbnavigator), and link them together with some properties, and have it work without writing a lick of code -- just like I once did with Delphi 3 over a decade ago. So far, Lazarus has not caught up with D3, much less D6.

With MySQL 4 or 5? I doubt it.

And with the latest Delphi versions, you'll also fail. They also need an applyupdates call, just like fpc does.

This is not a problem of fpc, but more a problem that you don't know how to use it (yet). Or if you want, a documentation problem.

Joost.

Reply by email

Howard Lee Harkness
to Luca Olivetti: En/na Howard Lee Harkness ha escrit: Mmmh, I have it working as you say with sqlite and…

That is on my list of things to try as soon as I have the time.

Luca Olivetti wrote 23 lines
En/na Howard Lee Harkness ha escrit: > What I REALLY wanted was to be able to drop some components on a form > (connection, query, datasource, dbgrid, and dbnavigator), and link them > together with some properties, and have it work without writing a lick > of code -- just like I once did with Delphi 3 over a decade ago. So far, > Lazarus has not caught up with D3, much less D6. Mmmh, I have it working as you say with sqlite and the zeos components (and IIRC I suggested that to you a while ago). Bye -- Luca -- Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Howard Lee Harkness -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080623/0b915ca0/attachment.html

Reply by email