TZConnection, MSSQL, Windows Authentication, TDS

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Radek
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.05.2012, 07:44

TZConnection, MSSQL, Windows Authentication, TDS

Post by Radek »

Can TZConnection connect to MSSQL with "Windows Authentication" using a FreeTDS_MsSQL>=2005 protocol?
If so, how to set properties of TZConnection so as to achieve this goal?

Best regards,
Radek
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by marsupilami »

Hello Radek,

it seems, this is perfectly possible. Just leave username and password empty and you will be connected with trusted authentication. This requires freetds to be compiled with SSPI.
With best regards,

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

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by EgonHugeist »

Nope it isn't, there is a opened ticked on FreeTDS.org or our compilated lib's are wrong.

I've been excluding this approch. Trying this raises a bad AV in the lib...

Sorry have to pass. With the ntwdblib.dll it works like a charm.
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
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by marsupilami »

Hello Michael,

indeed I didn't take the libs from svn for the test. I downloaded the R0_95 release from github and compiled it using Visual Studio 2013 Community Edition and Cmake. With this library I can connect to my local SQL Server 2008R2 without specifying a username and a password. If I do a select current_user I get dbo as a result. I get the same result if I use trusted authentication in SQL Server Studio. I will attach my life here later on. Bur beware - it depends on the runtime libs of Visual Studio 2013.

Best regards,

Jan
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by miab3 »

Jan,

Can you share this compiled version?
Even better both Win32 and Win64.

Michal
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by marsupilami »

Hello Radek, hello Michael,

I attached the library that I generated yesterday to this post. I took the source from the Releases part of the FreeTDS github repository. If you go by the version number, the download from the FreeTDS website is an even more current version (0.95.80) but currently I don't have the time to compile it and redo the tests, I did yesterday.

The attached library is built with Visual Studio 2013 Update 4. It depends on the MSVCR120.DLL which basically means the C++ 2013 runtime libraries. It is a 32 Bit version. Although it is named sybdb.dll it connected to MSSQL without problems.

With best regards,

Jan
You do not have the required permissions to view the files attached to this post.
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by miab3 »

Jan,

I think it is not good library.
See attachment
err_dblib.png
Michal
You do not have the required permissions to view the files attached to this post.
Radek
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.05.2012, 07:44

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by Radek »

Jan,

your library works without any problem, of course after installation of "Visual C++ Redistributable Packages for Visual Studio 2013".

Thank you very much.

Best regards,
Radek
Radek
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.05.2012, 07:44

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by Radek »

Michal,

could you send me that problematic strings, I would like to test them in my project.

Best regards,
Radek
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by marsupilami »

Hello Michal,

I only did a small test. I will have to setup a test database to use the zeos tests against. But then I am interested in your configuration. What Server are you using? Which driver and which character set did you use in Zeos? What is the character set of your database? What are the correct strings that should have been displayed? I see a column named TABLE_NAME. Did you get that data using TZSQLMetadata?
The library I suplied is compiled without ICONV suport. So that might be a reason for data transliteration to fail.
With best regards,

Jan
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by miab3 »

@Jan, @Radek,

Connect ( attached) app to your server (with large amounts of tables) and click All.
I tested on DXE2-32, DX10 Seattle-32; MSSQL 2008,2012.
Free_bad.zip
Michal
You do not have the required permissions to view the files attached to this post.
Radek
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.05.2012, 07:44

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by Radek »

Michal,

I haven't found anything wrong during a test using your project. I tested it on Win 64bit, DXE2, MSSQL 2008 R2. A table from ZQuery1 had near 1000 rows. I opened ZQuery1 and scrolled down so as to review all records, in effect haven't found incorrect entries.


Regards,
Radek
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by marsupilami »

Hello Michal,

I connected to some databases yesterday and also didn't find a problem. But then these only had about 50 to 70 tables. I also created a table with some german umlauts to have some characters that exceed the typical ascii range. But everything went fine. I can only make assumptions on why that is.

I also think about coming up with a test that will create a lot of tables with random names that use unicode characters in their name and see what happens. But I assume, I will not be able to do that before the weekend. To take my test environment closer to your environment it would be good to know which version of Microsoft SQL Server you use.

With best regards,

Jan
Jan
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by miab3 »

@Jan,

"it would be good to know which version of Microsoft SQL Server you use."

MS SQL EXPRESS:
DBMS name = Microsoft SQL Server
DBMS version = 10.50.2500

DBMS name = Microsoft SQL Server
DBMS version = 11.00.5343

Delphi 2007, XE2, 10 Seattle
ZEOS 7.2 r 3779

Michal
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: TZConnection, MSSQL, Windows Authentication, TDS

Post by marsupilami »

Hello Michal,

thank you - I will prepare the test. I just want to know wether that lib works or not - and also wether it might be concerned as some kind of a Zeos bug :-)
I will let you know about the test results and post the test procedure here.

Best regards and have a nice weekend,

Jan
Post Reply