English 中文(简体)
联系在利用自动数据交换系统目标连接反倾销时如何使用?
原标题:How is ConnectionString used when connecting to AD using ADsDSOObject?
  • 时间:2011-10-04 11:21:32
  •  标签:
  • delphi
  • ado

最近,我接手了一些Delphi法典(这是Delphi5,但我认为这很重要),这些守则使用LDAP提出了问题。 该法典非常令人困惑,因为它既包括连接,又直接设定了财产。 有一个安装方案,其中含有一些自动处理参数。 守则中哪些部分是相关的,哪些部分可以削减? 如果安装方案存在不必要的问题,我特别感兴趣。

  • Is it possible to simplify the code? (i.e. does ConnectionString (or any of the containing parameters) have any use in this code?)
  • Are Data Source (given as ADserver in installation program) or Location (given as ADlocation in installation program) used in call to Open or Execute?

我试图删除<条码>aADOlinkion.provider:= ADsDSOObject ; 或“联系标准”,以及电话工作。 删除<> 该呼吁当然失败了。 该法典是用来检查反倾销连接的,在为用户询问这些团体时,也存在类似的(但更长的)密码区。

Connecstr_S:= Provider=ADsDSOObject;Encrypt Password=False;Data Source= +
  Tsystem.programsettings.sADserver+ ;Location= +
  Tsystem.programsettings.sADlocation+ ;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648 ;
aADOconnection:=TADOConnection.create(nil);
aADOcmd:=TADOCommand.create(nil);
aADOconnection.loginprompt:=false;
aADOconnection.commandtimeout:=30;
aADOconnection.connectoptions:=coConnectUnspecified;
aADOconnection.CursorLocation:=cluseclient;
aADOconnection.isolationlevel:=ilCursorStability;
aADOconnection.mode:=cmunknown;
aADOconnection.provider:= ADsDSOObject ;
aADOcmd.commandtype:=cmdUnknown;
aADOcmd.Paramcheck:=false;
aADOcmd.commandtimeout:=30;
aADOcmd.Prepared:=false;
aADOconnection.ConnectionString:=Connecstr_S;
aADOcmd.Connection:=aADOconnection;
aADOconnection.open;
result:=true;
try
  SQL:= select displayname from  +quotedstr( LDAP:// +Tsystem.programsettings.sADbaseDN)+
      where   +Tsystem.programsettings.sADuseridAttribute+ = +quotedstr( aaaaaaa );
  aADOcmd.CommandText:=SQL;
  t:=aADOcmd.Execute;
except
  On E:EOleException do result:=false;  //network connection probably missing
end;
aADOconnection.close;
aADOcmd.free;
aADOconnection.free;
问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签