Subject | Re: AW: AW: [IBO] Updating data ? |
---|---|
Author | Helen Borrie |
Post date | 2003-04-11T08:58:08Z |
At 09:22 AM 11/04/2003 +0200, you wrote:
for the datamodule:
object DataModule1: TDataModule1
OldCreateOrder = False
OnCreate = DataModuleCreate
Left = 2
Top = 162
Height = 480
Width = 696
object IB_Connection1: TIB_Connection
PasswordStorage = psNotSecure
SQLDialect = 3
Params.Strings = (
'PATH=C:\TEMP\TEST.GDB'
'CHARACTER SET=ISO8859_1'
'USER NAME=SYSDBA'
'SQL DIALECT=3'
'PROTOCOL=TCP/IP')
Left = 56
Top = 32
SavedPassword = '.JuMbLe.01.432B0639073E0E4B49'
end
object IB_Transaction1: TIB_Transaction
IB_Connection = IB_Connection1
AutoCommit = True
Isolation = tiCommitted
Left = 152
Top = 32
end
object IB_DataSource1: TIB_DataSource
Dataset = IB_Query1
Left = 64
Top = 128
end
object IB_Query1: TIB_Query
DatabaseName = ':C:\TEMP\TEST.GDB' // SEE THE EXTRA ':' AT THE START?
IB_Connection = IB_Connection1
IB_Transaction = IB_Transaction1
SQL.Strings = (
'SELECT *'
'FROM PROGRAMSTOMONITOR')
ColorScheme = False
MasterSearchFlags = [msfOpenMasterOnOpen, msfSearchAppliesToMasterOnly]
RequestLive = True
BufferSynchroFlags = []
FetchWholeRows = True
Left = 152
Top = 128
end
end
First thing, you have your datamodule and your form in the wrong creation
order. In the DPR file, move this line up so it is ahead of the line
that creates the form:
Application.CreateForm(TDataModule1, DataModule1);
Also, notice, you have no KeyLinks defined - need to define PROGRAMNO.
Now you need to define GeneratorLinks for ProgramNo.
In GeneratorLinks:
PROGRAMNO=PROGRAMSTOMONITORGEN
Next, you need to go to the ColumnAttributes for the query and set the
REQUIRED attribute of PROGRAMNO to false.
I also commented out this line, as this project has the transaction set to
Autocommit and it's all you need for now.
The other thing is to go to the ib_connection and select your transaction
component for DefaultTransaction.
Now it works. :-)
Helen
>Hello Hellen,I'm the One-L Helen... :-)
>Yep, got it, and found several problems. It will help to look at the .dfm
>Maybe it is easier to help me if there is a little demo.dpr showing what I
>am doing (wrong).
>I placed it for download at : www.qutronic.de/download/IboProblem.zip
>
>It has the backuped (test-) database in it.
for the datamodule:
object DataModule1: TDataModule1
OldCreateOrder = False
OnCreate = DataModuleCreate
Left = 2
Top = 162
Height = 480
Width = 696
object IB_Connection1: TIB_Connection
PasswordStorage = psNotSecure
SQLDialect = 3
Params.Strings = (
'PATH=C:\TEMP\TEST.GDB'
'CHARACTER SET=ISO8859_1'
'USER NAME=SYSDBA'
'SQL DIALECT=3'
'PROTOCOL=TCP/IP')
Left = 56
Top = 32
SavedPassword = '.JuMbLe.01.432B0639073E0E4B49'
end
object IB_Transaction1: TIB_Transaction
IB_Connection = IB_Connection1
AutoCommit = True
Isolation = tiCommitted
Left = 152
Top = 32
end
object IB_DataSource1: TIB_DataSource
Dataset = IB_Query1
Left = 64
Top = 128
end
object IB_Query1: TIB_Query
DatabaseName = ':C:\TEMP\TEST.GDB' // SEE THE EXTRA ':' AT THE START?
IB_Connection = IB_Connection1
IB_Transaction = IB_Transaction1
SQL.Strings = (
'SELECT *'
'FROM PROGRAMSTOMONITOR')
ColorScheme = False
MasterSearchFlags = [msfOpenMasterOnOpen, msfSearchAppliesToMasterOnly]
RequestLive = True
BufferSynchroFlags = []
FetchWholeRows = True
Left = 152
Top = 128
end
end
First thing, you have your datamodule and your form in the wrong creation
order. In the DPR file, move this line up so it is ahead of the line
that creates the form:
Application.CreateForm(TDataModule1, DataModule1);
Also, notice, you have no KeyLinks defined - need to define PROGRAMNO.
Now you need to define GeneratorLinks for ProgramNo.
In GeneratorLinks:
PROGRAMNO=PROGRAMSTOMONITORGEN
Next, you need to go to the ColumnAttributes for the query and set the
REQUIRED attribute of PROGRAMNO to false.
I also commented out this line, as this project has the transaction set to
Autocommit and it's all you need for now.
The other thing is to go to the ib_connection and select your transaction
component for DefaultTransaction.
Now it works. :-)
Helen