三层次结构在局域网上没问题,在Internet上,客户机连接时服务器拒绝访问......

zouwenyan 2002-01-08 01:29:03
三层次结构在局域网上没问题,在Internet上,客户机连接时服务器拒绝访问是
什么原因,是不是服务器要开那个服务?
...全文
162 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
itren 2002-06-27
  • 打赏
  • 举报
回复
应该开放 211 端口! 这样应该可以!
对了问一句: 你们的系统是实际应用的吗?? 有多少个客户端啊?
wylove 2002-04-06
  • 打赏
  • 举报
回复
应该没有问题,我用的是Socketconnection!
suvi 2002-04-06
  • 打赏
  • 举报
回复
如果你是在internet上通过客户机连接server,建议不要用dcomconnection,这样多数时间是联不上的,internet的结构太复杂了,可以采用socketconnection来连接
jywsm 2002-04-06
  • 打赏
  • 举报
回复
如果是win2000的服务器,将midas.dll拷到winnt\system32目录下
zouwenyan 2002-01-08
  • 打赏
  • 举报
回复
怎样设连接方式通过防火墙呢?
ltmb118 2002-01-08
  • 打赏
  • 举报
回复
联结方式,是否通过防火墙
sxgs 2002-01-08
  • 打赏
  • 举报
回复
自己重载控件
unit myDBCombo;
interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,DB;

type
TcolorDBCombo = class(TComboBox)
private
{ Private declarations }
{ Private declarations }
FSeparator:string;
FCurrentID:string;
// FCurrentData:string;
Fstringlist:TstringList; //在STRINGLIST中包含两部分,前部分是AINDEXFIELD,后面
FSpaceText:string; //部分是ADATAFIELD,中间用|隔开
FAddtionalData:Boolean;
bShowSpace:Boolean;
bShowID:Boolean; function GetCurrentID:string;
function GetCurrentData:string;
function GetIndexData(const IndexID:integer):string;
procedure SetKeyValue(sVal:string);
protected

{ Protected declarations }
public
{ Public declarations }
property ItemIndex;
property Datas[const IndexID:integer]:string read GetindexData;
procedure FillItems(ADataset:TDataset;AShowField:string;AIndexField:string;ADataField:string);
published
{ Published declarations }
property style;
property Items;
property Separaror:string read Fseparator write Fseparator;
property ShoeID:Boolean read bShowID write bShowID;
property ShowSpace:Boolean read bShowSpace write bShowSpace;
property AddtionalData:Boolean read FAddtionalData write FAddtionalData;
property SpaceText:string read FSpaceText write FSpaceText;
property CurrentID:string read GetCurrentID;
property CurrentData:string read GetCurrentData;
property KeyValue:string write SetKeyValue;
property OnKeyDown;
constructor create(AOwner :TComponent);override;
destructor destroy;override;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('Standard', [TcolorDBCombo]);
end;

constructor TcolorDBCombo.create(AOwner:Tcomponent);
begin
inherited;
Fseparator:='';
FCurrentID:='';
bShowSpace:=false;
bShowID:=true;
FAddtionalData:=False;
Self.style:=csDropDownList ;
FstringList:=TstringList.Create;
end;

destructor TcolorDBCombo.destroy;
begin
FstringList.Free;
inherited;
end;

procedure TcolorDBCombo.FillItems(ADataset:TDataset;AShowField:string;AIndexField:string;ADataField:string);
var ABookMark:TBookMark;

begin
ABookMark:=ADataSet.GetBookMark;
Self.Items.clear;
FstringList.clear;
if ADataSet.Active then
begin

if bShowSpace then
begin
if FAddtionalData then
begin
Self.Items.Add(FSpaceText);
FstringList.Add(''+'|'+'');
end
else
begin
Self.Items.Add(FSpaceText);
FstringList.Add('');
end;
end;
try
ADataSet.First;
while not ADataSet.Eof do
begin
if AIndexField<>'' then
begin
if not bShowID then
begin
Self.Items.Add(ADataSet.FieldByName(AShowField).AsString);
if FAddtionalData then
FstringList.Add(ADataSet.FieldByName(AIndexField).AsString+
'|'+ADataSet.FieldByName(ADataField).AsString)
else
FstringList.Add(ADataSet.FieldByName(AIndexField).AsString);
end
else
begin
Self.Items.Add(ADataSet.FieldByName(AIndexField).AsString +
FSeparator + ADataSet.FieldByName(AShowField).AsString);
if FAddtionalData then
FstringList.Add(ADataSet.FieldByName(AIndexField).AsString+
'|'+ADataSet.FieldByName(ADataField).AsString)
else
FstringList.Add(ADataSet.FieldByName(AIndexField).AsString);
end;
end
else
Self.Items.Add(ADataSet.FieldByName(AShowField).AsString);
ADataSet.Next;
end;
except
MessageBox(Handle,'填写下拉框错误,请检查字段是否存在!','错误',MB_ICONERROR);
end;//try..except
ADataSet.GotoBookMark(ABookMark);
ADataSet.FreeBookmark(ABookMark);
end
else
MessageBox(Handle,Pchar(ADataSet.Name+'没有打开'),'错误',MB_ICONERROR);
Self.ItemIndex:=0;//Display First Item
end;

function TcolorDBCombo.GetCurrentID:string;
var str:string;
begin
if ItemIndex <> -1 then
begin
if FAddtionalData then
begin
str:= FStringList.Strings[ItemIndex];
Result:=copy(str,1,Pos('|',str)-1);
end
else
Result:=FStringList.Strings[ItemIndex];
end
else
Result := '';
end;

function TcolorDBCombo.GetCurrentData:string;
var str:string;
begin
if ItemIndex<>-1 then
begin
if FAddtionalData then
begin
str:= FStringList.Strings[ItemIndex];
Result:=copy(str,Pos('|',str)+1,Length(str)-Pos('|',str));
end
else
Result:=FStringList.Strings[ItemIndex];
end
else
Result:='';
end;

function TcolorDBCombo.GetIndexData(const IndexID:integer):string;
var str:string;
begin
if FAddtionalData and (IndexID<>-1) then
begin
str:=FStringList.Strings[IndexID];
Result:=copy(str,Pos('|',str)+1,Length(str)-Pos('|',str));
end
else
result:='';
end;

procedure TcolorDBCombo.SetKeyValue(sVal: string);
var Index:Integer;
str:string;
begin
if sVal='' then exit;
for Index:=0 to FStringList.Count-1 do begin
if FAddtionalData then begin
str:=FStringList.Strings[Index];
str:=copy(str,Pos('|',str)+1,Length(str)-Pos('|',str));
if str=sVal then begin
self.ItemIndex:=Index;
Exit;
end;
end else begin
str:=FStringList.Strings[Index];
if str=sVal then begin
self.ItemIndex:=Index;
Exit;
end;
end;

end;

end;

end.

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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