菜
菜鸟㈠号
Unregistered / Unconfirmed
GUEST, unregistred user!
主要实现的功能是将本地的ACCESS的数据上传到远程的SQL SERVER 数据库中,现在出现的问题是:提示我ODBC 调用失败!请各位帮帮忙解决以下!谢谢!
代码如下:
SQLStr:='insert into [odbc;driver=sql server;server='+edt_IP.Text+';user id='+edt_UserName.Text+';password='+edt_Password.Text+';database=csedu].Yw_Course select * from Yw_Course';
ADOQry.Connection.BeginTrans;
try
with ADOQry do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Execsql;
end;
Application.messagebox('上传成功!','提示');
ADOQry.Connection.CommitTrans;
except on E:Exception do
begin
Application.messagebox(pchar('上传失败!原因:'+e.Message+''),'提示');
ADOQry.Connection.RollbackTrans;
end;
end;
代码如下:
SQLStr:='insert into [odbc;driver=sql server;server='+edt_IP.Text+';user id='+edt_UserName.Text+';password='+edt_Password.Text+';database=csedu].Yw_Course select * from Yw_Course';
ADOQry.Connection.BeginTrans;
try
with ADOQry do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Execsql;
end;
Application.messagebox('上传成功!','提示');
ADOQry.Connection.CommitTrans;
except on E:Exception do
begin
Application.messagebox(pchar('上传失败!原因:'+e.Message+''),'提示');
ADOQry.Connection.RollbackTrans;
end;
end;