三层结构问题???????????????????

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
...全文
75 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hzb 2001-07-18
  • 打赏
  • 举报
回复
你调用了SocketConnection1.connected:=true;
了吗?
geliang 2001-07-18
  • 打赏
  • 举报
回复
Variant does not reference an automation object
这个错误说明,你的客户端没有连上服务端,看看网络是否有问题
┏━┯━┓
┃太 阳┃
┠ 的 ┨
┃光 芒┃
┗━┷━┛

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧