请大家帮我修改一下吧:procedure TForm1.Button1Click(Sender: TObject);
var connstr:string;
begin
A1.Close ;
connstr:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+edit1.Text+
';User ID=Admin;Mode=ReadWrite;Persist Security Info=True;'+
'Jet OLEDB:Database Password=;Jet OLEDB:Engine Type=1';
A1.ConnectionString:=connstr;
A1.Open;
try
aq1.Close;
aq1.SQL.Clear ;
aq1.SQL.Add('back database to disk='+''''+edit1.Text+'''');
//aq1.SQL.Add('insert into 总数据库..总任务书 select * from 核对后数据库..任务书');
aq1.ExecSQL ;
edit1.Text :=inttostr(aq1.RecordCount);
except
showmessage('失败!');
end;
总提示错误!
back ……的完整格式是什么?怎样实现将ACCESS库中的数据追加到SQL库里?!
var connstr:string;
begin
A1.Close ;
connstr:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+edit1.Text+
';User ID=Admin;Mode=ReadWrite;Persist Security Info=True;'+
'Jet OLEDB:Database Password=;Jet OLEDB:Engine Type=1';
A1.ConnectionString:=connstr;
A1.Open;
try
aq1.Close;
aq1.SQL.Clear ;
aq1.SQL.Add('back database to disk='+''''+edit1.Text+'''');
//aq1.SQL.Add('insert into 总数据库..总任务书 select * from 核对后数据库..任务书');
aq1.ExecSQL ;
edit1.Text :=inttostr(aq1.RecordCount);
except
showmessage('失败!');
end;
总提示错误!
back ……的完整格式是什么?怎样实现将ACCESS库中的数据追加到SQL库里?!
解决方案 »
- 使用TFTPServer控件如何得到当前发送了多少?
- 关于多表关联的几种方法的优劣势
- 简单的函数写法,delphi不熟
- 求助各位高手。。。怎么把WebBrowser中的内容保存为eml格式
- 怎么delphi7中的TDBListBox我从来没用起过。
- 请教这个自定义报表字段的功能是如何实现的,
- 今天你散分了没?如今流行散分...我也散~~~up有分
- 关于扫描仪的一个十分不解的问题???,进来看看?
- 模拟按下TAB键
- 100分求"TServerSock"et和TClientSocket向Indy平滑过渡的问题
- 关于程序发布的问题
- 大侠救急啊!我的delphi的tlabel控件的caption属性栏里没法显示中文,但是界面上可以显示中文,这是怎么回事啊,我都重装过几次了!!
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
try
adoconnection1.Connected:=False;
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=master;Data Source=FRIEND-YOFZKSCO;'+
'Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=FRIEND-YOFZKSCO;Use Encryption for Data=False;Tag with column collation when possible=False';
adoconnection1.Connected:=True;
with adoQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('Backup DataBase sfa to disk ='''+opendialog1.FileName+'''');
ExecSQL;
end;
except
ShowMessage('±?·Y꧰ü');
Exit;
end;
end;
Application.MessageBox('1§?2?ú£?êy?Y±?·Y3é1|','ìáê?',MB_OK + MB_ICONINFORMATION);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
try
adoconnection1.Connected:=false;
adoconnection1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=master;Data Source=FRIEND-YOFZKSCO;'+
'Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=FRIEND-YOFZKSCO;Use Encryption for Data=False;Tag with column collation when possible=False';
adoconnection1.Connected:=true;
with adoQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('Restore DataBase sfa from disk ='''+opendialog1.FileName+'''');
ExecSQL;
end;
except
ShowMessage('???′꧰ü');
Exit;
end;
end;
Application.MessageBox('1§?2?ú£?êy?Y???′3é1|','ìáê?',MB_OK + MB_ICONINFORMATION);
end;
http://search.csdn.net/Expert/topic/1879/1879680.xml?temp=.6882288
backup database 数据库实例名称 to 对应的备份设备 with init
aq1.SQL.Clear ;
aq1.SQL.Add('backup database 核对后数据库 to disk=D:\MSSQL7\Data\zsjk.mdf');
aq1.ExecSQL ;
运行时提示“缺少insert 、update、”等错误,为何?如何做才可以?!