Search found 227 matches

by brace
Wed 28 Sep 2022 08:06
Forum: SQL Server Data Access Components
Topic: Error when parameter type si not defined and param is null
Replies: 3
Views: 9588

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

Thanks for the replies, I confirm I use prAuto, so I will make sure to avoid undefined type and null param from now on.

Issue solved for me.
by brace
Tue 02 Aug 2022 14:04
Forum: SQL Server Data Access Components
Topic: Error when parameter type si not defined and param is null
Replies: 3
Views: 9588

Error when parameter type si not defined and param is null

In a TMSQuery with only one parameter of type integer, if the parameter type is not specified in the PAramers section, when I execute the query with null parameter I have:

Invalid input parameter values. Check the status values for detail.

THis occurs only on some machines, while in the others it works.

Which could be the reason?

The workaround is set the parameter type to integer.

I am using SDAC 10.1.1 on Delphi 10 Seattle, the problematic machine is Win Server 2012R2.

Thanks.
by brace
Mon 29 Jul 2019 08:56
Forum: SQL Server Data Access Components
Topic: Get old value of modified field on TMSQuery.AfterUpdateExecute event
Replies: 1
Views: 4976

Get old value of modified field on TMSQuery.AfterUpdateExecute event

How i can get the old value of a modified field in the TMSQuery.AfterUpdateExecute event?

i can get the field name with "Params.Items.Name" and the value with "Params.Items.Value", i would like to get the "Old value" too.

Code: Select all

//code sample to get fieldname and value of modified field

procedure TForm1.MyQueryAfterUpdateExecute(
  Sender: TCustomMSDataSet; StatementTypes: TStatementTypes; Params: TMSParams);
var
  I : Integer;
  sFieldName : string;
  vValue : Variant;
begin
  inherited;
  if StatementTypes = [stUpdate]  then
  begin
    for I := 0 to Params.Count-1 do
    begin
    // Get modified field name
      sFieldName := Params.Items[I].Name;          
    // Get value of modified field
      vValue := Params.Items[I].Value;
    end;
  end;
end;
by brace
Fri 19 Jul 2019 07:34
Forum: SQL Server Data Access Components
Topic: How to pass unicode literal in parameter?
Replies: 7
Views: 5240

Re: How to pass unicode literal in parameter?

It is ftString, since the query SQL is created at runtime as in the code snippet, how can i force the parameter Datatype to Thanks.
by brace
Thu 18 Jul 2019 14:58
Forum: SQL Server Data Access Components
Topic: How to pass unicode literal in parameter?
Replies: 7
Views: 5240

Re: How to pass unicode literal in parameter?

By using asstring i got unicode chars inserted as "?????" in SQL Server, i had to do a workaround avoiding using parameters bu by creating the update statement like this:

MSQuery1.SQL.Text := 'UPDATE MYTABLE SET FIELD = N''' + unicodeText+ '''';

I use DElphi 10, so it seems what you are telling me is not right.
by brace
Thu 18 Jul 2019 10:24
Forum: SQL Server Data Access Components
Topic: How to pass unicode literal in parameter?
Replies: 7
Views: 5240

How to pass unicode literal in parameter?

How to tell SDAC to use a unicode literal?

I would like that when i do

Code: Select all

  MSQuery1.SQL.Text := 'UPDATE MYTABLE SET FIELD= :NEWVALUE';
  MSQuery1.ParamByName('NEWVALUE').AsString := '゚ワノラルユナ';
  MSQuery1.Execute;
SDAC passes N'゚ワノラルユナ' instead of 'ワノラルユナ', how is doable?

WIthout this nvarchar strings are casted to varchar.

Thanks.
by brace
Fri 14 Jun 2019 08:08
Forum: SQL Server Data Access Components
Topic: HElp with deletion in master detail
Replies: 3
Views: 5064

Re: HElp with deletion in master detail

Thanks for the reply.
So you mean that there is no way to obtain deletiong thgouh "cached updates" withotu using the cascade delete option?

I thought that teh dataset could handle this.

Thanks.
by brace
Wed 12 Jun 2019 16:45
Forum: SQL Server Data Access Components
Topic: HElp with deletion in master detail
Replies: 3
Views: 5064

HElp with deletion in master detail

Hi, as a continuation of this topic viewtopic.php?t=27242

i tried to implement a sample in which master detail relationship is done with MasteSource.

when i delete a master record anyway i do not see that the deletion of the details is done correctly.

i will send the sample to support.

i hope you can reply since i am stuck.

THanks.
by brace
Mon 04 Feb 2019 08:48
Forum: SQL Server Data Access Components
Topic: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier
Replies: 5
Views: 1923

Re: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier

Last message from my side:

I finally realized tha you removed EmptyString from SDAC (from version 8.2.8 or 8.2.9 i did not check when but i realized it is in 8.2.8), either by mistake or it was your choice.

Since EmptyString is a simple constant defined as '' and since i was using it only in one unit i simply stopped using it and replaced it with ''

I don't need a reply but you can consider reviewing the fact that apps built with SDAC "stopped having access to EmptyString constant from 8.2.9". Thanks.
by brace
Fri 01 Feb 2019 11:10
Forum: SQL Server Data Access Components
Topic: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier
Replies: 5
Views: 1923

Re: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier

I add one last thing i noticed:
by seraching in source code (i have SDAC with source code even if i usually i use the simple installer) i realize that in 2 units you define EmptyString, in particular i see it in unit VirtualTable and SqlClasses.pas

Still i do not understand why the compiler shows "System.Classes".

Thanks.
by brace
Fri 01 Feb 2019 11:03
Forum: SQL Server Data Access Components
Topic: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier
Replies: 5
Views: 1923

Re: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier

I add more details:

with SDAC 8.1.7 I see:
Image

while with SDAC 8.2.9 (without any other code change):
Image

This is what i experience.

It seems that somehow upgrading from 8.1.7 to 8.2.9 EmptyString does not work anymore.

Since EmptyString does not exist in Delphi RTL I feel like SDAC up to now made it work.

I use Delphi 10 Seattle.

Thanks.
by brace
Fri 01 Feb 2019 10:04
Forum: SQL Server Data Access Components
Topic: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier
Replies: 5
Views: 1923

Re: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier

After reinstalling 8.1.7 I noticed that in fact EmptyString is a constant resolved like this

EmptyString = '' from System.string

but after installing 8.2.9 somehow this is not resolved anymore.

It seems that adding a global constant (in a unit where i define common things) bypasses the problem, but i'd like to have a comment from your side to confirm this behavior.
by brace
Thu 31 Jan 2019 11:36
Forum: SQL Server Data Access Components
Topic: After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier
Replies: 5
Views: 1923

After upgrading from 8.1.7 to 8.2.9 EmptyString is Undefined Identifier

I just upgraded from SDAC 8.1.7 to 8.2.9 and after build i get
E2003 Undeclared identifier: 'EmptyString'

The code I maintain is pretty old, did you remove EmptyString? Is it safe I declare a global const

const
EmptyString = '';

or not?

Removing EmptyString is a known breaking change? Why it is not listed in history?

Thanks.
by brace
Tue 27 Mar 2018 11:22
Forum: SQL Server Data Access Components
Topic: Questions on DisconnectedMode
Replies: 1
Views: 1438

Questions on DisconnectedMode

How TMSConnection's DisconnectedMode works?

How to check that it works from management studio process explorer? Should i see some users not online?

Why do you say
it may be useful for [...] operating in an unstable or expensive network
?

from https://www.devart.com/sdac/docs/work_d ... ctmode.htm