How can i interact directaly with data using UIB-Unified Interbase (http://www.progdigy.com/?page_id=5)?
in my current application i can set dataset of datasource to table component (IBdac component from Devart.com)which enable me editing the data in开发者_运维问答 the dbgrid directly . uibdataset is read only which that is means it is not possible to edit any things except through update sql. how can i achieve this properties with UIB components? i'm using delphi xe, firebird2.5.
I am not familier with UIB, but did you try to use the TUIBQuery component? In my application I always use IBQuery to modify data.
Actually I use:
TIBQuery -> TDataSetProvider -> TClientDataSet -> TDataSource
If you are using a TDataSetProvider
you have to invoke TClientDataSet.ApplyUpdates
to post the changes to underlying database.
you have to put a TUIBDatabase, TUIBTransaction then a TUIBDataSet and it should be connected to your TUIBDatabase and TUIBTransaction at the end put a TDataSource connected to the TUIBDatabase: TUIBDatabase -> TUIBDatabase -> TDataSource
e.g
object UIBTransaction1: TUIBTransaction
DataBase = UIBDataBase1
end
object UIBDataBase1: TUIBDataBase
Params.Strings = (
'sql_dialect=3'
'lc_ctype=NONE'
'user_name=SYSDBA'
'password=masterkey'
'sql_role_name=')
DatabaseName =
'D:\FIREBIRDTEST.FDB'
UserName = 'SYSDBA'
PassWord = 'masterkey'
LibraryName = 'fbclient.dll'
end
object UIBDataSet1: TUIBDataSet
Transaction = UIBTransaction1
Database = UIBDataBase1
SQL.Strings = ('select * from CUSTOMER;')
end
object DataSource1: TDataSource
DataSet = UIBDataSet1
end
you can also use the option mentioned by markus_ja however don't use TUIBQuery but use TUIBDatabase instead
TUIBDatabase -> TUIBDatabase -> TDataSetProvider -> TClientDataSet -> TDataSource
simply paste this code on your form:
object UIBTransaction1: TUIBTransaction
DataBase = UIBDataBase1
Left = 120
Top = 112
end
object UIBDataBase1: TUIBDataBase
Params.Strings = (
'sql_dialect=3'
'lc_ctype=NONE'
'user_name=SYSDBA'
'password=masterkey'
'sql_role_name=')
DatabaseName =
'D:\FIREBIRDTEST.FDB'
UserName = 'SYSDBA'
PassWord = 'masterkey'
LibraryName = 'fbclient.dll'
end
object UIBDataSet1: TUIBDataSet
Transaction = UIBTransaction1
Database = UIBDataBase1
SQL.Strings = ('select * from CUSTOMER;')
end
object DataSetProvider1: TDataSetProvider
DataSet = UIBDataSet1
end
object ClientDataSet1: TClientDataSet
ProviderName = 'DataSetProvider1'
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
end
i hope that helps
精彩评论