三层结构问题???????????????????
canna 2001-07-18 05:31:56 我在服务器段定义了一个函数
procedure TDCOMSam.SetDatabaseName(const DBName, PassWord,
UserName: WideString);
begin
try
Database1.Close;
Database1.AliasName := DBName;
if Password <> '' then
begin
Database1.Params.Values['User Name'] := UserName;
Database1.Params.Values['PASSWORD'] := Password;
end;
Database1.Open;
except
{ If the DB open fails, assume it is because a password is required and
raise a special exception which will cause the client to prompt the
user for a password }
on E: EDBEngineError do
if (Password = '') then
raise Exception.Create('Password Required') else
raise;
end;
end;
在客户段调用
SocketConnection1.AppServer.SetDatabaseName('Center','','sa');
可总是出现以下错误:
Variant does not reference an automation object