PP4S - Updating A Microsoft Access Database Using Lazarus
PP4S - Updating A Microsoft Access Database Using Lazarus
Page 1
Home
Tutorials
Challenges
Programs
Resources
Glossary
Deleting a column W e added to the form the three buttons (from the Standard tab) and the DBEdit and the DBMemo (from the Data Controls tab). You can see the code for the buttons in uDatabaseEdit.pas and the properties of the components in uDatabaseEdit.lfm. W e have emboldened important properties .
Program DatabaseEdit in action The essential code of the files needed for program DatabaseEdit follows. You can download the three code files, the database and our components.dsn file in form_database_edit.zip. You will probably need to change the path of the database. The Microsoft Access page in the Lazarus W iki explains how to create your own .dsn file if ours does not work for you. uDatabaseEdit .pas
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html
17/10/2012 10:58:40
Page 2
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html
17/10/2012 10:58:40
Page 3
object frmComponents: TfrmComponents Left = 493 Height = 335 Top = 275 Width = 697 Caption = 'Delphi Components' ClientHeight = 335 ClientWidth = 697 LCLVersion = '0.9.30' object DBGrid1: TDBGrid Left = 3 Height = 256 Top = 8 Width = 352 Color = clWindow Columns = < item Title.Caption = 'Type' Title.Font.Style = [fsBold] Width = 100 FieldName = 'Name' end item Title.Caption = 'Prefix' Title.Font.Style = [fsBold] Width = 100 FieldName = 'Abbreviation' end item Title.Caption = 'Palette' Title.Font.Style = [fsBold] Width = 100 FieldName = 'Palette' end> DataSource = Datasource1 TabOrder = 0 end object DBNavigator1: TDBNavigator Left = 56 Height = 25 Top = 272 Width = 241 BevelOuter = bvNone ChildSizing.EnlargeHorizontal = crsScaleChilds ChildSizing.EnlargeVertical = crsScaleChilds ChildSizing.ShrinkHorizontal = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 100 ClientHeight = 25 ClientWidth = 241 DataSource = Datasource1 TabOrder = 1 VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh]
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html
17/10/2012 10:58:40
Page 4
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html
17/10/2012 10:58:40
Page 5
program DatabaseEdit; uses Interfaces, Forms, uDatabaseEdit; {$R *.res} begin Application.Initialize; Application.CreateForm(TfrmComponents, frmComponents); Application.Run; end.
components.dsn [ODBC] DRIVER=Microsoft Access Driver (*.mdb) UID=admin UserCommitSync=Yes Threads=3 SafeTransactions=0 PageTimeout=5 MaxScanRows=8 MaxBufferSize=2048 FIL=MS Access DriverId=25
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html
17/10/2012 10:58:40
Page 6
About Privacy
Terms Acknowledgements
Links
Mission
Contact
PP4S 2010-12
dita powered. Copyright 2010-12 Pascal Programming for Schools. All rights reserved.
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html
17/10/2012 10:58:40