Search found 301 matches

by Ludek
Wed 21 Sep 2022 16:04
Forum: SQL Server Data Access Components
Topic: Error when parameter type si not defined and param is null
Replies: 3
Views: 9452

Re: Error when parameter type si not defined and param is null

It is provider dependent. You are apparently using prAuto. Happens with oledb, works with native client. or vice versa, i'm not sure. I am just always filling the parameter data type.
by Ludek
Tue 20 Sep 2022 19:45
Forum: SQL Server Data Access Components
Topic: access violation with local master/detail
Replies: 1
Views: 7122

access violation with local master/detail

Hi, I'm having trouble with local master/detail, when the master dataset is tvirtualtable and the detail is tmsquery - it just crashes with each scroll in master dataset.
It was working fine in older sdac versions (i.e. 7.3.16), but the 9.x, 10.x, even the newest 10.2.0 crashes.
I was able to get rid of the exception with this change:

Code: Select all

function TCRRecordSet.GetMappedDataBuf(FieldDesc: TFieldDesc; DataBuf: IntPtr; var DataLen: Word; var DataType: Word; var HasParent, IsFixed, NativeBuffer: boolean): IntPtr;
{$IFNDEF LITE}
var
  MappedBufSize: Integer;
  TmpBuf: IntPtr;
{$ENDIF}
begin
{$IFNDEF LITE}
  if {start add}(FieldDesc is TCRFieldDesc) and {end add}(TCRFieldDesc(FieldDesc).OnDemandConverter <> nil) then begin
but this is just a "solution".
please fix it, it disallows upgrading to newer delphi versions (there is no sdac 7.3.16 for delphi alexandria)
by Ludek
Mon 07 Jun 2021 13:16
Forum: SQL Server Data Access Components
Topic: process all records in sorted dataset
Replies: 1
Views: 13429

process all records in sorted dataset

Hi, do you have a recommended way to process all records in sorted dataset? Especially how to handle the situation, when the field, that is included in indexfieldnames, has to be changed.

typically, such code does not process the whole dataset, but only the (initially) first record - because with the first ".post" it jumps to last position (because of active sorting) and the next ".next" call activates eof and the iterations stops.

Code: Select all

dataset.indexfieldnames := 'somefield';
dataset.first;
while not dataset.eof do begin
  dataset.edit;
  datasetsomefield.asinteger := maxint;
  dataset.post;
  dataset.next;
end;
Thanks for ideas. I have the only one - set indexfieldnames before this iteration to empty string, but i don't find this nice...
by Ludek
Tue 18 Dec 2018 16:26
Forum: SQL Server Data Access Components
Topic: LocalMasterDetail position in detail dataset lost
Replies: 4
Views: 4439

Re: LocalMasterDetail position in detail dataset lost

Thank you for information. I am really using an older version of sdac - and I overlooked this change in the revision history.
I'll try some newer version, thanks, Ludek.
by Ludek
Tue 04 Dec 2018 12:28
Forum: SQL Server Data Access Components
Topic: LocalMasterDetail position in detail dataset lost
Replies: 4
Views: 4439

LocalMasterDetail position in detail dataset lost

Hi,
I'm having trouble with master/detail behavior in localmasterdetail = true setting. Everytime I change non-key(!) field in master dataset, I lose position in detail dataset - detail gets apparently refiltered (why?) and the detail dataset jumps back to first record.
Can I get rid of such unpleasant behavior?
Thanks, Ludek.
by Ludek
Tue 04 Apr 2017 12:59
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

It is really sursprisingly long month from jan 27 to apr 04... and there is still no version. :evil:
by Ludek
Mon 06 Mar 2017 08:17
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

hi, much more than a month passed, no new version available ... :x
by Ludek
Wed 25 Jan 2017 06:35
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

Do you have an estimation of availability of the "next build"?
Thanks, Ludek.
by Ludek
Tue 24 Jan 2017 07:59
Forum: Oracle Data Access Components
Topic: Clearing DataSet.IndexFieldNames without restoring original order?
Replies: 14
Views: 4090

Re: Clearing DataSet.IndexFieldNames without restoring original order?

Hi, is such version already available? (I need it in SDAC)
Or, at least, would you mind publishing the needed change in sources?
Thanks, Ludek.
by Ludek
Tue 03 Jan 2017 10:01
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

Hi, are there any news?
by Ludek
Tue 20 Dec 2016 13:46
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

Thank you!
by Ludek
Thu 15 Dec 2016 08:24
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

btw. I even tried to use uaRetry, but it does retry immediately. I need to retry it after updates of the other unsaved records...
by Ludek
Thu 15 Dec 2016 08:18
Forum: SQL Server Data Access Components
Topic: uaSkip & OldValue
Replies: 12
Views: 4686

Re: uaSkip & OldValue

That does not help me. For sdac, all the changes are ukModify. Only internally, in OnUpdateRecord, i generate inserts, updates, deletes (background: the tmsquery contains a left outer join, user just changes data in dbgrid, but i internally do deletes for the records being emptied, inserts for records changed from null to some not null value and updates for changing on not null value to other not null value).
So the question remains: how can I see the "real" oldvalue in onupdaterecord handler in the second run, when the first one ended with uaSkip (because that time it was not yet possible to save them because of some unique constraint and the f*cking sql server not knowing feature called deferred updates...)

Thank you for some tip!
Ludek.
by Ludek
Wed 01 Jun 2016 12:54
Forum: SQL Server Data Access Components
Topic: dataset editing/inserting & filter
Replies: 1
Views: 1702

dataset editing/inserting & filter

Hi,
I'm having following problem: i have a filtered tmsquery (filter = 'a = 5'), do an append, set a to 6 and post. the record immediately after post disappers. Even in afterpost is an other record active. This makes big trouble, if the code in afterpost event somehow analyzes the currently posted data (as it analyzes an other record).

Is there some nice way to "correct" this? Or, at least, to disallow such post, if the new record won't meet the filter criteria? I tried anything like subclassing tmsquery and writing code like

Code: Select all

procedure TMyMSQuery.InternalPost;
begin
    if (data as TMemData).OmitRecord((data as TMemData).GetCurrentItem) then
      raise Exception.Create('Saved record would be filtered out. Save aborted.');
  inherited;
end;
byt currentitem is nil dataset in dsinsert state... also OmitRecord(activebuffer) did not work... Some other way?
Thanks, Ludek.