1)在调用
var look:string;
look:=inputbox('系统提示','请输入要查询班级的代号!','');
后,希望此值在
application.MessageBox('查无此班级'+look+'代号,系统允许添加[代号不能为空]!','系统认证通过',mb_ok) 各位:明白我的意思吗?也就是说在后者引用look,我这样不行,编译出现错误: [Error] Unit3.pas(87): Incompatible types: 'String' and 'PAnsiChar'
怎样改正?
2:)我利用DBgrid,datasource和adoquery查询时:(一个按扭用于查询,一个用于删除)问题就是说怎样删除当前记录指针指向的数据行。即想在按扭单击事件中通过再更改ADOquery的SQL属性来删除。也就是说删除的条件
语句怎样写?
我的大意也就是:delete from 表名 where kk=dbgrid中当前行第一列的值我就是不会描述这个条件属性,指教
解决方案 »
- Delphi中查看Paradox表结构类型
- 关于Web Service的性能、安全的讨论
- 为什么资源文件无法通过编译到.exe文件里呢?
- 如何用程序来创建一个access数据库?
- 如何实现运行从ftp上下载下来的应用程序
- 哎!开发ADO连接ORACL的客户端程序,非得装ORACL巨大的客户端软件,谁有办法打包时包括ORACL所需的文件,且最少
- 数据库恢复的一个问题?可能问过,但请回答我!谢谢
- 怎样得到一个程序调用了那些DLL。
- 大家救救我,我找一个控件,
- 61.133.186.16 地址是哪儿的呀?
- 如何把listbox1里当前选中的一项添加到另一个listbox里?
- 大家来讨论一下WEB SERVER+mts 四层结构的多帐套系统的设计方法
str:='查无此班级'+look+'代号,系统允许添加[代号不能为空]!';
application.MessageBox(pchar(str)','系统认证通过',mb_ok)
sSql:= '查无此班级'+look+'代号,系统允许添加[代号不能为空]!';
MessageDlg(sSql,mtConfirmation, [mbYes, mbNo], 0) ;
var
sSql:String;
begin
adoquery.close;
adoquery.sql.clear;
sSql:='delete from'+ 表名 +'where kk='+dbgrid中当前行第一列的值;
adoquery.sql.add ('sSql');
adoquery.execute;
end;
Forms,Dialogs,
Unit1 in 'Unit1.pas' {Form1};{$R *.RES}
var
look:string;
aa:string;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
look:=inputbox('系统提示','请输入要查询班级的代号!','');
aa:='查无此班级'+look+'代号,系统允许添加[代号不能为空]!';
application.MessageBox(pchar(aa),pchar('系统认证通过'),1);
Application.Run;
end.Value Numeric value MeaningIDOK 1 The user chose the OK button.
IDCANCEL 2 The user chose the Cancel button.
IDABORT 3 The user chose the Abort button.
IDRETRY 4 The user chose the Retry button.
IDIGNORE 5 The user chose the Ignore button.
IDYES 6 The user chose the Yes button.
IDNO 7 The user chose the No button.
当前行当然是可以随时变动的。
2、
delete from 表名 where kk=dbgrid,datasource.dataset.fieldvlaues['kk']