Search found 10 matches

by Rnest
Fri 03 Jan 2014 12:20
Forum: SQL Server Data Access Components
Topic: Error generating SQL Scripts [v 6.9.17]
Replies: 1
Views: 1247

Error generating SQL Scripts [v 6.9.17]

after autogenerating SQL in MSQuery editor, params/values are replaced by "?"
e.g.:
INSERT INTO [dbo].[CRGRID_TEST]
([Id], [Name], [Country], [City], [Street], [BirthDate], [Job], [Hiredate], [Sal], [Remarks])
VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
by Rnest
Thu 31 Jan 2013 13:29
Forum: SQL Server Data Access Components
Topic: TMSChangeNotification and subscription timeout message
Replies: 9
Views: 1578

Re: TMSChangeNotification and subscription timeout message

Thank you very much. This is the best solution and resolves the problem, especially when combined with TMSNotification.OnChange event handler.
by Rnest
Wed 30 Jan 2013 09:19
Forum: SQL Server Data Access Components
Topic: TMSChangeNotification and subscription timeout message
Replies: 9
Views: 1578

Re: TMSChangeNotification and subscription timeout message

SQL Server version: 10.50.1600
NativeClient: 10.52.4000.0
by Rnest
Fri 25 Jan 2013 13:04
Forum: SQL Server Data Access Components
Topic: TMSChangeNotification and subscription timeout message
Replies: 9
Views: 1578

Re: TMSChangeNotification and subscription timeout message

OnChange event handler is null in this project.
In this case it may be message forced by sqlNativeClient library (?) so maybe there is any way to handle it, eg by making some tweaks in SDAC Library sources?
by Rnest
Thu 24 Jan 2013 14:49
Forum: SQL Server Data Access Components
Topic: TMSChangeNotification and subscription timeout message
Replies: 9
Views: 1578

TMSChangeNotification and subscription timeout message

In my project I'm using TMSChangeNotification component to reflect changes in my SQL tables. In some situations (eg. app error), SQLBroker queues are orphanded, hanging on server. Then, after next run of application, message "The subscription timeout expired" is displayed. How to avoid/hide/handle this message?
by Rnest
Mon 12 Mar 2012 09:46
Forum: SQL Server Data Access Components
Topic: TMSQuery editor, SQL Generator - error generating SQL statem
Replies: 4
Views: 1195

TMSQuery editor, SQL Generator - error generating SQL statem

Autogenerated update, insert, strings are invalid in newest SDAC edition (6.1.5)
e.g. for TMSQuery.SQL.Text:

Code: Select all

SELECT [EMPNO]
      ,[ENAME]
      ,[JOB]
      ,[MGR]
      ,[HIREDATE]
      ,[SAL]
      ,[COMM]
      ,[DEPTNO]
  FROM [SDACDemos].[dbo].[emp]
as generated result for insert text you get

Code: Select all

INSERT INTO [dbo].[emp]
  ([EMPNO], [], [], [], [], [], [])
VALUES
  (:[EMPNO], :[], :[], :[], :[], :[], :[])
SET :[EMPNO] = SCOPE_IDENTITY()
and for update text:

Code: Select all

UPDATE [dbo].[emp]
SET
  [EMPNO] = :[EMPNO], [] = :[], [] = :[], [] = :[], [] = :[], [] = :[], [] = :[]
WHERE
  [ENAME] = :[Old_ENAME]
Tested on RAD Studio 2010, SQL Server 2008

Best regards
Ernest
by Rnest
Tue 07 Feb 2012 11:09
Forum: SQL Server Data Access Components
Topic: "Invalid class typecast" error with DLL's TMSQuery.Post
Replies: 3
Views: 2884

Thank you Andrey, this solution works perfect!
by Rnest
Sat 04 Feb 2012 13:38
Forum: SQL Server Data Access Components
Topic: "Invalid class typecast" error with DLL's TMSQuery.Post
Replies: 3
Views: 2884

"Invalid class typecast" error with DLL's TMSQuery.Post

"Invalid class typecast" error calling TMSQuery.Post method of dynamically created TMSQuery in a dll.

Steps to reproduce:
1) Use included demo app {InstallDemosDir}\Demos\Miscellaneous\Dll
2) Modify procedure ShowForm in DLLMain unit:

procedure ShowForm; cdecl;
var
msq: TMSQuery;
begin
with TfmDllMain.Create(Application) do
begin
msq := TMSQuery.Create(nil);
msq.Connection := ExternalMSConnection;
//put proper SQL statements
msq.SQL.Text := 'SELECT * FROM some_table';
msq.SQLInsert.Text := 'INSERT INTO some_table...';
msq.SQLUpdate.Text := 'UPDATE some_table...';
msq.Open;
msq.Append;
msq.FieldByName('some_field').AsInteger := 0;
msq.Post; <<- invalid typecast error occurs
msq.Free;


Inc(FormCount);
Caption := IntToStr(FormCount) + '. ' + Caption;
MSQuery.Connection := ExternalMSConnection;
MSQuery.Active := True;
Show;
end;
end;
by Rnest
Fri 19 Oct 2007 16:08
Forum: SQL Server Data Access Components
Topic: Invalid class typecast message on opening MSQuery in DLL
Replies: 7
Views: 5612

Invalid class typecast message on opening MSQuery in DLL

I have a problem with opening more than one TMSQuery in DLL form (SDac ver 4.30.00.12)
Proper MSConnection is assigned to DLL's variable of TMSConnection type.
Next, this variable is assigned to MSQuery1 and MSQuery2 as "connection" property.
MSQuery1.Open - opens query, but if I try to open next Query, error message "Invalid Class Typecast" is displayed.

There is simple way to reproduce this problem. Just use demo app from SDAC Demos\Win32\Miscellaneous\Dll, place second TMSQuery component on DLL form, assign "ExternalConnection" and open query from code.