Home > Back-end >  Turn the database link problem!!!!!!!!!!
Turn the database link problem!!!!!!!!!!

Time:09-21

A Delphi procedure, others do, connection of SQL server 2005, not on a computer, before is good, can normal connection, today with another software, the Delphi can not connect to database, always link failure, network no problem, the default port 1433 is no problem, the odbc connection is normal,

CodePudding user response:

Quote what mistake?

CodePudding user response:

Link to database failed

CodePudding user response:

This problem is much, may be a firewall, client and server configuration has a problem, the IP address,,,

CodePudding user response:

This problem is strange, the Delphi software installed in several computer, this computer is to install the software we can't access, the other can be used normally, so after installing our software is suspected, some dynamic DLL is replaced, just don't know is which dynamic libraries

CodePudding user response:

Database IP address changed, changed or port

CodePudding user response:

reference 5 floor jjpweb reply:
database IP address changed, changed or port

Other client software can be normal use, network installed several computers, is to install our software of the two

CodePudding user response:

Check and IP configuration, close the firewall,
In addition, the server and client configuration needs to be checked,

CodePudding user response:

refer to 7th floor lyhoo163 response:
check and IP configuration, close the firewall,
In addition, the server and client configuration needs to be checked,

Don't know whether upstairs to see my problem, other computers can be connected, but it can't connect, can set up an odbc connection, in SQL server 2005 express can access the server database, network, the port, IP is no problem, should be out on the configuration of the machine, just don't know where to

CodePudding user response:

refer to the original poster sunghj response:
a Delphi program that others do, connection of SQL server 2005, not on a computer, before is good, can normal connection, today with another software, the Delphi can not connect to database, always link failure, network no problem, the default port 1433 is no problem, the odbc connection is normal also,


Estimates is the port the software accounted for (if it is to use DATASNAP), check,,,

CodePudding user response:

 Function InitMSSQLServerRegData (Server: String) : Boolean; 
Const
MSSQLPath='SOFTWARE \ Microsoft \ MSSQLServer \ Client \ SuperSocketNetLib \';
ConntoPath='SOFTWARE \ Microsoft \ MSSQLServer \ Client \ ConnectTo';
Var
Reg: TRegistry;
The begin
Result:=False;
Reg:=TRegistry. Create;
Reg. RootKey:=HKEY_LOCAL_MACHINE;
With reg do begin
Try
If OpenKey (ConnToPath, True) then Writestring (Server, 'DBMSSOCN, + Server +', 1433 ');
CloseKey;
If OpenKey (MSSQLPath + Np, True) then
CloseKey;
If OpenKey (MSSQLPath + Tcp, True) then Writeinteger (' DefaultPort, 1433);
CloseKey;
Result:=True;
Except,
end;
end;
Reg. CloseKey;
Reg. Free;
end;

Use this function to initialize the server IP address, reset the PC
  • Related