[patch_done] MSSQL transaction

Forum related to MS SQL Server

Moderators: gto, cipto_kh, EgonHugeist

delphichem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 07.11.2012, 20:08

Post by delphichem »

Hi guys,

The problem is that I forget to delete the parameter NTAuth=True from connection properties.

I've no access violation,
but I get:
DBError :_[20012] :_Server name not found in configuration files
DBError :_[20013] :_Unknown host machine name.
Is there a special option de connect with FreeTDS with nt authentification?

Thanks

Regards
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

delphichem,

uhh i must admit i've never tried to connct with NTAuthentification. I use allways username and password. So it works very well. Anyway you've pointed me to an exception which shouldn't happpen. Can you tell me the settings to reproduce that exception?

Edit: from FreeTDS.org
The Microsoft SQL Server is listening, my configuration and environment are set up per question 6.1, but logins still fail.

Yeah, make sure you're not relying on integrated security. Microsoft supports two security models in three permutations:

Windows NT Authentication Mode (Windows NT Authentication)
Standard Mode (SQL Server Authentication)
Mixed Mode (Windows NT Authentication and SQL Server Authentication)

You need either Standard or Mixed mode.

"Windows NT Authentication", often called "integrated security", relies on Microsoft's trusted connections and is not supported by FreeTDS. In it, user's network security attributes are established at network login time. When connecting to the database server, SQL Server uses Windows NT facilities to determine the validated network username. SQL Server then permits or denies login access based on that network username alone, without requiring a separate login name and password.

FreeTDS supports the traditional database security model, which Microsoft terms "SQL Server Authentication" but is frequently known as "standard security". Username+Password pairs have to be passed to the server explicitly.

Mixed Mode allows users to connect using either authentication method. Users who connect through a Windows NT account can make use of trusted connections in either Windows NT Authentication Mode or Mixed Mode. After successful connection to SQL Server, the security mechanism is the same for both modes.

Update: support for "Windows NT Authentication" has been added in 0.60. This code is quite new, hasn't seen much use and might work. ;)
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
delphichem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 07.11.2012, 20:08

Post by delphichem »

EgonHugeist,

It's very easy, you add NTAuth=True in Connection's Properties, and try to connect.
Create a new project,
here is DFM source

Code: Select all

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 243
  ClientWidth = 527
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object ZConnection1: TZConnection
    ControlsCodePage = cCP_UTF16
    UTF8StringsAsWideField = True
    Properties.Strings = (
      'NTAuth=True'
      'AutoEncodeStrings=ON'
      'controls_cp=CP_UTF16')
    Port = 0
    Protocol = 'FreeTDS_MsSQL>=2005'
    Left = 160
    Top = 80
  end
end
.pas

Code: Select all

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ZAbstractConnection, ZConnection;

type
  TForm1 = class(TForm)
    ZConnection1: TZConnection;
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

end.
I think that because in ZDbcDbLib it's not excluve when you choose FtreeTDS, FProvider = dpMsSQL. It may be safer in line 347 to add and not FFreeTDS, but I'm not sure if it is the best way

Cheers
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

delphichem,

confirmed and patch applied. Thanks. Rev 2005 \testing.

Now what about success on your side?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
delphichem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 07.11.2012, 20:08

Post by delphichem »

EgonHugeist

Thanks :)

I've test server authentification, it work well :) but I don't know how to use NT authentification, I've read the documentation on your post, it seems possible to use freeTDS and connect using nt authentification since 0.60 version, but they don't show us how :(

Thanks again for your help
DanielK
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 21.02.2019, 13:56

Re: [patch_done] MSSQL transaction

Post by DanielK »

EgonHugeist!

Thank you! This is very helpful!
Post Reply