UniTable 5.2.5 D7 on SQLServer: Access violation when instering records
Posted: Wed 19 Feb 2014 07:52
Hello everybody,
I've updated from UniDac 3.xx to 5.2.5 with source code for Delphi7. Deinstallation and Installation worked well. After recompiling
my application I got multiple access violations when posting records. I broke down the problem in a seperated test app as follows:
UniConnection1.Connect;
UniTable1.FieldDefs.Add ('ID', ftAutoInc, 0);
UniTable1.FieldDefs.Add ('AnyValue', ftInteger, 0);
UniTable1.Open;
UniTable1.Append;
UniTable1AnyValue.Value:= 42;
UniTable1.Post; <- access violation here!!!
To give you an impression of the component's properties, here the interesting part of the dfm:
object SQLServerUniProvider1: TSQLServerUniProvider
Left = 72
Top = 32
end
object UniConnection1: TUniConnection
ProviderName = 'SQL Server'
Database = 'Test'
SpecificOptions.Strings = (
'SQL Server.Authentication=auWindows'
'SQL Server.OLEDBProvider=prNativeClient')
Server = '.\SQLEXPRESS'
Left = 72
Top = 88
end
object UniTable1: TUniTable
TableName = 'Test1'
Connection = UniConnection1
KeyFields = 'ID'
Left = 72
Top = 144
object UniTable1ID: TAutoIncField
FieldName = 'ID'
ReadOnly = True
Required = True
end
object UniTable1AnyValue: TIntegerField
FieldName = 'AnyValue'
end
end
As you can see, everything is pretty basic. For the test app I created the database and the table using the management studio before
the app start.
WITHOUT adding the FieldDefs there is no problem!!! But because the structure of my main application I have several tables where I
have to fill the FieldDefs in one module, create the table in another module and open/append/post in a third one. Let's simply say: I
need it!
Does anybody know, how that bug can be fixed? Or does anybody have a workaround (except not adding FieldDefs!)?
Your help will be much appreciated! If there is a better place to post this topic, please let me know.
Thanks
Ralph
I've updated from UniDac 3.xx to 5.2.5 with source code for Delphi7. Deinstallation and Installation worked well. After recompiling
my application I got multiple access violations when posting records. I broke down the problem in a seperated test app as follows:
UniConnection1.Connect;
UniTable1.FieldDefs.Add ('ID', ftAutoInc, 0);
UniTable1.FieldDefs.Add ('AnyValue', ftInteger, 0);
UniTable1.Open;
UniTable1.Append;
UniTable1AnyValue.Value:= 42;
UniTable1.Post; <- access violation here!!!
To give you an impression of the component's properties, here the interesting part of the dfm:
object SQLServerUniProvider1: TSQLServerUniProvider
Left = 72
Top = 32
end
object UniConnection1: TUniConnection
ProviderName = 'SQL Server'
Database = 'Test'
SpecificOptions.Strings = (
'SQL Server.Authentication=auWindows'
'SQL Server.OLEDBProvider=prNativeClient')
Server = '.\SQLEXPRESS'
Left = 72
Top = 88
end
object UniTable1: TUniTable
TableName = 'Test1'
Connection = UniConnection1
KeyFields = 'ID'
Left = 72
Top = 144
object UniTable1ID: TAutoIncField
FieldName = 'ID'
ReadOnly = True
Required = True
end
object UniTable1AnyValue: TIntegerField
FieldName = 'AnyValue'
end
end
As you can see, everything is pretty basic. For the test app I created the database and the table using the management studio before
the app start.
WITHOUT adding the FieldDefs there is no problem!!! But because the structure of my main application I have several tables where I
have to fill the FieldDefs in one module, create the table in another module and open/append/post in a third one. Let's simply say: I
need it!
Does anybody know, how that bug can be fixed? Or does anybody have a workaround (except not adding FieldDefs!)?
Your help will be much appreciated! If there is a better place to post this topic, please let me know.
Thanks
Ralph