TMSQuery Blocking Application.

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eta
Posts: 7
Joined: Wed 25 Oct 2017 14:06
Location: Turkey, Istanbul
Contact:

TMSQuery Blocking Application.

Post by eta » Tue 24 Jul 2018 13:05

Hi everyone,

We are using SDAC (8.0.3) component with C++ Builder 6.
I've created simple test application that contains TMSConnection and TMSQuery.
I've only changed these properties of TMSQuery.

TMSQuery->FetchAll = false
TMSQuery->Options->NonBlocking = true
TMSQuery->Options->QueryRecCount = true

Here is table and there is 10 rows. (SQL Server 2012)

Code: Select all

USE [TEST]
GO

/****** Object:  Table [dbo].[TEST]    Script Date: 24-7-2018 15:48:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TEST](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[FNAME] [varchar](10) NULL,
 CONSTRAINT [PK_TEST] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO
Unit1.h

Code: Select all

//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "DBAccess.hpp"
#include "MemDS.hpp"
#include "MSAccess.hpp"
#include <DB.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TMSConnection *MSConnection1;
        TMSQuery *MSQuery1;
        TButton *btnOpen;
        TButton *btnClose;
        TButton *btnLast;
        void __fastcall btnCloseClick(TObject *Sender);
        void __fastcall btnOpenClick(TObject *Sender);
        void __fastcall btnLastClick(TObject *Sender);
private:	// User declarations
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Unit1.cpp

Code: Select all

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "DBAccess"
#pragma link "MemDS"
#pragma link "MSAccess"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnCloseClick(TObject *Sender)
{
 MSQuery1->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnOpenClick(TObject *Sender)
{
 MSQuery1->SQL->Text = "SELECT * FROM TEST";
 MSQuery1->Open();        
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnLastClick(TObject *Sender)
{
 MSQuery1->Last();        
}
//---------------------------------------------------------------------------
I'm doing respectively below.
Step 1 : Click To button btnOpenClick.
Step 2: Click To button btnLastClick
Step 3: Click To Button btnCloseClick.

Application is blocking after clicking the btnCloseClick.

How to fix this problem ?
Thanks for support.

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: TMSQuery Blocking Application.

Post by Stellar » Thu 26 Jul 2018 12:49

Thank you for the information. We have fixed the issue, and the fix will be included in the next SDAC build.

eta
Posts: 7
Joined: Wed 25 Oct 2017 14:06
Location: Turkey, Istanbul
Contact:

Re: TMSQuery Blocking Application.

Post by eta » Thu 26 Jul 2018 14:37

Thanks for feedback.

Post Reply