Z
zhbforce
Unregistered / Unconfirmed
GUEST, unregistred user!
开发环境:Delphi6+Windows2000 Oracle 8.1.7
使用TSocketConnection,ADO
我开发了一个应用服务器程序,在应用服务器端定义了很多检索和更新数据库的函数,例如:
procedure TmAppJS973.UploadDataJbxx(const sXmbm: WideString;
var fData: OleVariant;
var iResult: Integer);
safecall;
begin
MainForm.changeUpdate;
if VarIsArray(fData) then
begin
sSql:='select * from xmxx where mxmbh='''+sXmbm+'''';
rs.Close;
rs.CommandText:=sSql;
rs.Open;
if rs.Eof then
begin
iResult:=0;
Exit;
end;
try
sSql:='UPDATE xmxx SET hzbz='''+fData[0]+''',phbz='''+fData[1]+''',f_xmbzr='''+
fData[2]+''',f_xmzxr='''+fData[3]+''',f_xmfzr='''+fData[4]+''',f_bsrq='''+fData[5]+
''' where mxmbh='''+sXmbm+'''';
cm.CommandText:=sSql;
cm.Execute;
iResult:=1;
except
on e:Exceptiondo
begin
iResult:=0;
ShowMessage('UploadDataJbxx catch an error.'+e.Message+sXmbm);
end;
end;
end
else
iResult:=0;
end;
//--------------------------------------------------------------------------------------------------------
procedure TmAppJS973.ReceiveDataJbxx(const sXmbm: WideString;
var fData: OleVariant;
var iResult: Integer);
safecall;
var
v:OleVariant;
begin
MainForm.changeRequest;
try
sSql:='select * from xmxx where mxmbh='''+sXmbm+'''';
rs.Close;
rs.CommandText:=sSql;
rs.Open;
if rs.Eof then
begin
iResult:=0;
Exit;
end;
v:=VarArrayCreate([0,5], varVariant);
v[0]:=rs.FieldByName('hzbz').AsString;
v[1]:=rs.FieldByName('phbz').AsString;
v[2]:=rs.FieldByName('f_xmbzr').AsString;
v[3]:=rs.FieldByName('f_xmzxr').AsString;
v[4]:=rs.FieldByName('f_xmfzr').AsString;
v[5]:=rs.FieldByName('f_bsrq').AsString;
fData:=v;
iResult:=1;
except
on e:Exceptiondo
begin
iResult:=0;
ShowMessage('ReceiveDataJbxx catch an error.'+e.Message+sXmbm);
end;
end;
end;
//------------------------------------------------------------------
实际运行期间不时的跳出“对象被打开”的错误信息,但是不会影响应用服务器的运行,我想
知道这是为什么? 是数据访问冲突?
使用TSocketConnection,ADO
我开发了一个应用服务器程序,在应用服务器端定义了很多检索和更新数据库的函数,例如:
procedure TmAppJS973.UploadDataJbxx(const sXmbm: WideString;
var fData: OleVariant;
var iResult: Integer);
safecall;
begin
MainForm.changeUpdate;
if VarIsArray(fData) then
begin
sSql:='select * from xmxx where mxmbh='''+sXmbm+'''';
rs.Close;
rs.CommandText:=sSql;
rs.Open;
if rs.Eof then
begin
iResult:=0;
Exit;
end;
try
sSql:='UPDATE xmxx SET hzbz='''+fData[0]+''',phbz='''+fData[1]+''',f_xmbzr='''+
fData[2]+''',f_xmzxr='''+fData[3]+''',f_xmfzr='''+fData[4]+''',f_bsrq='''+fData[5]+
''' where mxmbh='''+sXmbm+'''';
cm.CommandText:=sSql;
cm.Execute;
iResult:=1;
except
on e:Exceptiondo
begin
iResult:=0;
ShowMessage('UploadDataJbxx catch an error.'+e.Message+sXmbm);
end;
end;
end
else
iResult:=0;
end;
//--------------------------------------------------------------------------------------------------------
procedure TmAppJS973.ReceiveDataJbxx(const sXmbm: WideString;
var fData: OleVariant;
var iResult: Integer);
safecall;
var
v:OleVariant;
begin
MainForm.changeRequest;
try
sSql:='select * from xmxx where mxmbh='''+sXmbm+'''';
rs.Close;
rs.CommandText:=sSql;
rs.Open;
if rs.Eof then
begin
iResult:=0;
Exit;
end;
v:=VarArrayCreate([0,5], varVariant);
v[0]:=rs.FieldByName('hzbz').AsString;
v[1]:=rs.FieldByName('phbz').AsString;
v[2]:=rs.FieldByName('f_xmbzr').AsString;
v[3]:=rs.FieldByName('f_xmzxr').AsString;
v[4]:=rs.FieldByName('f_xmfzr').AsString;
v[5]:=rs.FieldByName('f_bsrq').AsString;
fData:=v;
iResult:=1;
except
on e:Exceptiondo
begin
iResult:=0;
ShowMessage('ReceiveDataJbxx catch an error.'+e.Message+sXmbm);
end;
end;
end;
//------------------------------------------------------------------
实际运行期间不时的跳出“对象被打开”的错误信息,但是不会影响应用服务器的运行,我想
知道这是为什么? 是数据访问冲突?