Home > Back-end >  A problem about ADOQuery UpdateBatch
A problem about ADOQuery UpdateBatch

Time:10-04

Is doing a project, the need to use more than one SQL Server, the problem can be simplified as follows:

1. Two SQL Server A and B, which, in A way through the Linked Server connected to B,

2. On Server A, through SQL Server Query Analyzer to perform the following SQL statement, there is no problem,
The UPDATE B.T ESTDB. Dbo. TESTTB SET T2='Y' WHERE T1=1

3. Create a Delphi procedure, add the following controls:
ADOConnection1: create A connection to A Server
ADOQuery1: write the SQL statement: SELECT * FROM B.T ESTDB. The dbo. TESTTB
Attribute set:
CacheSize - 1
CursorLocation - clUseClient
CursorType - ctStatic
LockType - ltBatchOptimistic
Datasource1: connection ADOQuery1
DBGrid1: connect the Datasource
For: perform the following statement
ADOQuery1. DisableControls;
ADOQuery1. UpdateBatch;
ADOQuery1. Close;
ADOQuery1. Open;
ADOQuery1. EnableControls;

4. Run the program, and then modify any data in the DBGrid, click save changes, for the application to the following error:
Insufficient base table information for updating or refreshing.

Excuse me, if anyone had faced the same problem, how to solve?

CodePudding user response:

Ado didn't know it, your table, the relationship between the suggestion or use Ado to execute SQL statements,

CodePudding user response:

Seldom used UpdateBatch have been use SQL statements, tone and shown below to see which go wrong,
  • Related