怎么样Delphi中ADOTable控件来执行access数据库
用SQL语句来执行
想要详细点的
用SQL语句来执行
想要详细点的
解决方案 »
- delphi 访问网络文件
- 如果将一个.pas文件加入到项目中呢?
- 求 DevExpress ExpressPrinting System for delphi 7
- 简单问题!!!!!!!!!
- 如何将ActionManager的Category及Action动态导入ActionMainMenuBar?
- 急!在delphi中新建一个文本文件的代码怎么写?
- DELPHI 开发WEBSERVICE,在IIS中浏览时出现以下错误No interface registered for URL '/soap/'
- 关于DateTimePicker控件的问题
- 做个短信信息提取的东东
- 如何自定义一个表示符?
- Delphi 字符串进行逻辑运算
- 继续散分
比如连接:procedure TMain_Frm.FormCreate(Sender: TObject);
begin
try
execcodesoft;
ADOConnection1.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+extractfilepath(Application.ExeName)+'Insdata.mdb;Persist Security Info=False';
ADOConnection1.LoginPrompt:=False;
ADOConnection1.Connected:=True;
label3.Caption:=FormatDateTime('ddd',Now);
except
ShowMessage('你的電腦未安裝CodeSoft軟體,請進入\\172.20.1.108程式網站-->安裝CodeSoft軟體再重新運行此程式!');
Application.Terminate;
Application.MessageBox('數據庫連接文件出錯!請與MIS聯系!!!', '錯誤',
MB_OK + MB_ICONSTOP);
Application.Terminate;
end;
end;
begin
if not (Key in ['1'..'9',#8,#13]) then key:=#0;
if Key=#13 then
begin
if Length(Trim(RzEdit7.Text))<>16 then
begin
RzEdit7.SetFocus;
RzEdit7.SelectAll;
RzEdit7.Clear;
exit;
end
else
begin
if not Insdata(ADOConnection1,RzEdit1.Text,RzEdit2.Text,RzEdit7.Text,CheckBox2) then
begin
label1.Caption:='NG';
label1.Font.Color:=clRed;
RzEdit7.Clear;
RzEdit7.SetFocus;
Exit;
end
else
begin
label1.Caption:='OK';
label1.Font.Color:=clGreen;
RzEdit8.SetFocus;
end;
end;
end;
end;
case kz4 of
0:ADOTable2.Fields.FieldByName('one').Value:=tmp;
1:ADOTable2.Fields.FieldByName('two').Value:=tmp;
2:ADOTable2.Fields.FieldByName('three').Value:=tmp;
3:ADOTable2.Fields.FieldByName('four').Value:=tmp;
4:ADOTable2.Fields.FieldByName('five').Value:=tmp;
5:ADOTable2.Fields.FieldByName('six').Value:=tmp;
6:ADOTable2.Fields.FieldByName('special').Value:=tmp;
end;
ADOTable2.Post;
inc(kz4);
我这样添加能不能以判断主键来添加呢
我这里是循环添加的 添加进去的时候就出现一个添加为一行
我的主键是自动增长的