Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 20 Apr 2024, 04:17

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 26 Feb 2020, 10:52 
Offline

Joined: 23 Feb 2020, 07:37
Posts: 6
How to execute dynamic SQL statements in ADOdatadriverEH of dbgrideh
for example: 'SELECT * FROM mytable WHERE ID>1'
thank you


Top
 Profile  
 
PostPosted: 26 Feb 2020, 20:31 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

Could you write in more detail what dynamic SQL means.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 27 Feb 2020, 06:28 
Offline

Joined: 23 Feb 2020, 07:37
Posts: 6
EhLibSupport wrote:
Hello

Could you write in more detail what dynamic SQL means.



How to write query statements


Top
 Profile  
 
PostPosted: 27 Feb 2020, 09:31 
Offline

Joined: 23 Feb 2020, 07:37
Posts: 6
cnczh wrote:
EhLibSupport wrote:
Hello

Could you write in more detail what dynamic SQL means.



How to write query statements



ADOConnectionProviderEh and ADODataDriverEh and MemTableEh and DataSource

How to execute ADODataDriverEh.SelectSql or UpdateSql or InsertSql or DeleteSql

for example

ADOConnectionProviderEh1.InlineConnection.ConnectionString := 'Provider=SQLOLEDB.1;Password=MYWORD;Persist Security Info=True;User ID=MYDATA;Initial Catalog=MYDATA;Data Source=127.0.0.1';
ADOConnectionProviderEh1.InlineConnection.Connected:= True;

message missing connection or connectionString




ADODataDriverEh.SelectSql.Text:='SELECT * FROM MYTABLE WHERE ...';
ADODataDriverEh.SelectSql.Open;
OR
ADODataDriverEh.SelectSql.Action;

Where is it written?

DBGridEh.Options.dgEditing:=true;
When the cell changes the content, it can't be null. Where to judge

If the value of cell is allowed to be null, I want to update the value of database to null. How to set


thank you very much


Top
 Profile  
 
PostPosted: 27 Feb 2020, 15:18 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

ADODataDriverEh.SelectSql or UpdateSql or InsertSql or DeleteSql
are executed automatically.

You need to assign
MemTableEh.DataDriver = ADODataDriverEh


When you open MemTableEh (MemTableEh.Active = True)
It executes ADODataDriverEh.SelectSql command and load data to MemTableEh buffer, so you can work with it.

When you MemTableEh.Edit and MemTableEh.Post record it executes ADODataDriverEh.UpdateSql
(If MemTableEh.CachedUpdates = False).

If MemTableEh.CachedUpdates = True then
after you Post, Delete, Insert in MemTableEh you need to call MemTableEh.ApplyUpdates to execute
UpdateSql or InsertSql or DeleteSql for the corresponding type of editing.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group