是这样的,我有一个问题我创建了一个临时表temp,我用update向里面更新数据。
可是发现有一些问题请大家看一下! query1.Close;
query1.sql.Clear;
query1.sql.add('update temp set temp.income_num=(select sum(book_total) from income_book where income_book.book_num=temp.book_num)'); query1.execsql;
end;
在这里where有错误,其他应设有问题 ,显示错误请大家庭看一下!
key violation 操作必须有一个可更新的的查询,
大家看一下我用的temp是一个临时表。环境地是access2000
可是发现有一些问题请大家看一下! query1.Close;
query1.sql.Clear;
query1.sql.add('update temp set temp.income_num=(select sum(book_total) from income_book where income_book.book_num=temp.book_num)'); query1.execsql;
end;
在这里where有错误,其他应设有问题 ,显示错误请大家庭看一下!
key violation 操作必须有一个可更新的的查询,
大家看一下我用的temp是一个临时表。环境地是access2000
解决方案 »
- ADO并行访问、修改数据库问题
- (一)11月19号结婚, 人生就只有一次.狂放520分兄弟们抢分啦, 月底接贴.
- "网络蚂蚁"和"FlashGet"的悬浮窗口的实现
- 关于一个文件是否存在且是否已打开的问题
- pagecontrol的问题,高手来
- ExpressBar中是否能把Group组的颜色改了呢?
- 请问有没有专门讲解Winsock API函数的书,纸张的书我也要!
- 用什么软件能将一个VB程序用图块来表示。我的VB程序直接编码,开始没有设计,代码越长越复杂,很难看清结构,现在想逆向成设计图,不知道
- 高手快来啊!!Delphi 中可以做不规则按钮吗??
- 怎样发现是否有 SOFTICE在运行?60分送上!!!
- 如何在B程序中获取A程序中的某些内容(如StringGrid中)
- socket编程
begin
Active := False; { The Table component must not be active }
{ First, describe the type of table and give it a name }
DatabaseName := '6';
TableType := ttparadox;
TableName := 'temp';
{ Next, describe the fields in the table }
with FieldDefs do
begin
Clear;
Add('book_num', ftstring, 4, True);
Add('book_name', ftString, 4, true);
Add('book_price', ftcurrency, 0, true);
Add('book_year', ftInteger, 0, true);
Add('book_month', ftinteger, 0, true);
Add('income_num', ftinteger, 0, true);
Add('outcome_num', ftinteger, 0, true);
Add('lastmonth_num', ftinteger, 0, true);
Add('thismonth_num', ftinteger, 0, true);
end;
{ Next, describe any indexes }
with IndexDefs do
begin
Clear;
{ The first index has no name because it is a Paradox primary key }
// Add('', 'book_num', [ixPrimary, ixUnique]);
// Add('Fld2Indx', 'book_num', [ixCaseInsensitive]);
table1.indexdefs:=table2.indexdefs;
end;
下面是临时表好象生成的时候就没有关键字,请你对我说一下如何处理这个问题。key 为book_num
query1.sql.Clear;
query1.sql.add('insert into temp (income_num) select sum (book_total) from income_book '); query1.execsql;
INSERT INTO TABLENAME VALUES(‘’,‘’)