Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Object Pascal Programming Language
  • Page:
  • 1

TOPIC:

ms sql connection problem 1 day 2 hours ago #19118

  • Miran Horjak
  • Miran Horjak's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
 Hi.
ms sql connection problem
64-bit operating system, x64-based processor
Windows 10 Enterprise
I try C5 8.70 and CT.50 .Has anyone successfully used any other component?

    SQLConnector1: TSQLConnector;
    SQLTransaction1: TSQLTransaction;
    ZConnection1: TZConnection;
I get only
       

Please Log in or Create an account to join the conversation.

Last edit: by Miran Horjak.

ms sql connection problem 18 hours 56 minutes ago #19119

  • Hank van Til
  • Hank van Til's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 1
  • Thank you received: 0
I had this same problem and managed to solve it with a bit of hunting.
My preference is for ZeosDb which works for most of my data servers I have to talk to.

1.  Get a copy of the correct DLL files to allow tZConnection to connect to MsSql from  FreeTDS.org  
2. Copy these DLL files (64bit versions) to your EXE folder: libcrypto-3-x64.dll, libiconv-2.dll, libssl-3-x64.dll, libsybdb-5
3. Use this code upon startup:
  try  // except
    ZConnection.Protocol       := 'mssql';
    ZConnection.HostName       := 'your host/domain here';
    ZConnection.Database       := 'your database here';
    ZConnection.User           := 'your user name here';
    ZConnection.Password       := 'your password here';
    ZConnection.Port           := 0;
    ZConnection.ReadOnly       := False;
    ZConnection.LoginPrompt    := False;
    ZConnection.AutoCommit     := True;
    ZConnection.ClientCodePage := 'UTF8';
    ZConnection.Properties.Clear;
    ZConnection.Properties.Add('RawStringEncoding=DB_CP');

    ZConnection.LibraryLocation := SysUtils.ExtractFilePath(Forms.Application.Exename) + 'libsybdb-5.dll'; // 'sybdb.dll';

    ZConnection.Connect;

    if ZConnection.Connected then begin
      Memo.Append('Zeos Connection is Open OK');
    end;

  except
    on E: Exception do begin
      Memo.Append('Error in connection');
    end;
end;  // except

Please Log in or Create an account to join the conversation.

  • Page:
  • 1