procedure SetCmbDict2(myComBox: TComboBox; iDictEntry :integer;iDictEntry2 :integer);
var
MyQuery :TAdoQuery;
SQLCode,StrTemp: string;
i: integer;
begin
try
MyQuery:= TadoQuery.Create(nil);
try
with MyQuery do
begin
Connection := Adocon;
if Active then Close;
SQL.Clear;
SQLCode := ' set rowcount 0 select subentry,dict_entry, dict_prompt'
+ ' from run..dictionary '
+ ' where dict_entry = ' + IntTostr(iDictEntry)
+ ' or dict_entry = ' + IntTostr(iDictEntry2)
+ ' and subentry != -1 '
+ ' and access_level != 3 '
+ ' order by subentry';
SQL.Add(SQLCode);
Open;
if not MyQuery.IsEmpty then
begin
with myComBox do
begin
Items.Clear;
for i := 0 to MyQuery.RecordCount - 1 do
begin
strTemp := FieldByName('dict_entry').Asstring + '.' + FieldByName('subentry').Asstring + '.' + FieldByName('dict_prompt').AsString;
myComBox.Items.Add(strTemp);
myComBox.ItemIndex :=0;
MyQuery.Next;
end;
end;
end;
end;
except
MyQuery.Free;
end;
finally
MyQuery.Free;
end;
end;
请各位高手帮我看看错在那里?
var
MyQuery :TAdoQuery;
SQLCode,StrTemp: string;
i: integer;
begin
try
MyQuery:= TadoQuery.Create(nil);
try
with MyQuery do
begin
Connection := Adocon;
if Active then Close;
SQL.Clear;
SQLCode := ' set rowcount 0 select subentry,dict_entry, dict_prompt'
+ ' from run..dictionary '
+ ' where dict_entry = ' + IntTostr(iDictEntry)
+ ' or dict_entry = ' + IntTostr(iDictEntry2)
+ ' and subentry != -1 '
+ ' and access_level != 3 '
+ ' order by subentry';
SQL.Add(SQLCode);
Open;
if not MyQuery.IsEmpty then
begin
with myComBox do
begin
Items.Clear;
for i := 0 to MyQuery.RecordCount - 1 do
begin
strTemp := FieldByName('dict_entry').Asstring + '.' + FieldByName('subentry').Asstring + '.' + FieldByName('dict_prompt').AsString;
myComBox.Items.Add(strTemp);
myComBox.ItemIndex :=0;
MyQuery.Next;
end;
end;
end;
end;
except
MyQuery.Free;
end;
finally
MyQuery.Free;
end;
end;
请各位高手帮我看看错在那里?
解决方案 »
- WinExec('cmd /c net use \\服务器地址\共享名称 "密码" /user:"用户名"', nil)
- 调试中的add watch的用法
- informix跨库操作的问题
- Delphi 1年后还有前途吗?
- delphi 7 菜鸟:为什么我的delphi7没有dbExpress工具栏?
- 开发MIDASG一定要用到类型库吗?
- 字符串的小问题
- 在adoquery中sql内能否写二个:delete from aa delete from bb,该如何写.
- 有用过webbrowser直接显示memorystream流的大虾吗??
- 如何做一个数据备份程序(关于Paradox的)?
- 请问哪里有“浏览目录对话狂“控件下啊?
- 一个关于进度条显示的问题
on e:EDatabaseError do
begin
if Application.MessageBOx('操作发生错误,是否显示错误信息?', '发生错误', mb_YesNo + mb_IconInformation ) = mrYes then
Application.MessageBox( PChar(e.Message), '错误信息', mb_Ok + mb_IconInformation );
Result:=false;
exit;
end;
有谁可以帮我看看SQL语句部分有没有错!
procedure SetCmbDict2(myComBox: TComboBox; iDictEntry :integer;iDictEntry2 :integer);
在有procedure的地方 或 private
{ Private declarations }或
public 后
加上
语句,然后执行,把Memo1在的文本复制到可以执得SQL语句的工具中,问题就很容易解决了
procedure 窗体名.SetCmbDict2(myComBox: TComboBox; iDictEntry :integer;iDictEntry2 :integer);
你地过程中引用了一个窗体中的adoconn吧. 如果想写一个单独的过程,干脆连adoConn也传进来吧.