Home > Back-end >  Service program ADOConnection in unable to connect to the database
Service program ADOConnection in unable to connect to the database

Time:09-29

Consult a great spirit, I ask a new question, Delphi6, use the following function to connect SQL 2008 database, all is well in desktop applications, the entrance to the same conditions in the service returns' system database connection failure 1, check the along while to find problems, I do not know why, the function code is as follows, please grant instruction,
My operating system XP, Server 2003 Server operating system, this function is only responsible for the connection,

The function LJSJK (ADOConnection: TADOConnection; Ss: string) : string;
Var
S0: string;
The begin
//connect to the database system operation
S0:=';
ADOConnection. Connected:=false;
ADOConnection. The ConnectionString:=ss;
ADOConnection. CursorLocation:=clUseClient;
Try
ADOConnection. Connected:=true;
Except,
S0:='system database connection failure 1;
end;
If s0="' then
If not (ADOConnection. Connected) then
S0:=2 ' 'system database connection failure;
LJSJK:=s0;
end;

CodePudding user response:

Wait me flowers also thanks, nobody answer, search baidu, yourself, originally is the permission problems, and yourself,

CodePudding user response:

It seems still have to depend on oneself ah,
Encounter problems to baidu first

CodePudding user response:

Mistakes show English quickly understand what reason be
  • Related