LAZARUS 1.2.4 and UniDAC MSSQL access

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tmac
Posts: 2
Joined: Sat 30 Aug 2014 15:12

LAZARUS 1.2.4 and UniDAC MSSQL access

Post by tmac » Sat 20 Sep 2014 08:12

Hello,

I need to connect to the database using MSSQL Express 208 UniDAC 5.3.9 for Lazarus.

Problem: SQL insert query editor / manager will be OK as query query below

Code: Select all

SELECT dbo.SKz.ID,dbo.SKz.RefSklad,dbo.SKz.RefStruct,dbo.SKz.IDS,dbo.SKz.Nazev,dbo.SKz.MJ,dbo.SKz.StavZ,dbo.SKz.ObjedP,dbo.SKz.ObjedV,dbo.SkSt.Vetev1,dbo.SkSt.Vetev2,dbo.SkSt.Vetev3,dbo.SKz.Reklam,dbo.sSklad.SText FROM dbo.SKz INNER JOIN dbo.sSklad ON dbo.SKz.RefSklad = dbo.sSklad.ID INNER JOIN dbo.SkSt ON dbo.SkSt.RefSklad = dbo.sSklad.ID AND dbo.SKz.RefStruct = dbo.SkSt.ID WHERE ((dbo.SKz.IDS LIKE '60082%') AND (dbo.SKz.Nazev LIKE '%'))
Calls using the same query ->

Code: Select all

DataModule1.sqSebekHlavni.SQL.Text = sQueryH; // SQueryH contains the above query
DataModule1.sqSebekHlavni.ExecSQL;
Reports an error connecting to the database. Can someone please advise me. UniConnection is of course Connected = true

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: LAZARUS 1.2.4 and UniDAC MSSQL access

Post by azyk » Mon 22 Sep 2014 12:02

Thank you for the information. We have reproduced the problem when the design-time SQL editor in TUniQuery doesn't save the content, and we will investigate it.
tmac wrote:Reports an error connecting to the database. Can someone please advise me. UniConnection is of course Connected = true
To avoid this error, before executing the query, set the TUniQuery.Connection property of the sqSebekHlavni component to the TUniConnection you are using. For example:

Code: Select all

DataModule1.sqSebekHlavni.Connection := DataModule1.UniConnection1;
Note: if you use Windows Authentication at connection to SQL Server, you should set the TUniConnection.SpecificOptions.Values['Authentication'] option to 'auWindows'.

tmac
Posts: 2
Joined: Sat 30 Aug 2014 15:12

Re: LAZARUS 1.2.4 and UniDAC MSSQL access

Post by tmac » Mon 22 Sep 2014 12:07

UniDAC use in the current version. Connecting the Delphi XE6 works for me but this code in Lazarus does not connect to MSSQL database. In design mode connection is working and data are available, after the translation or in debug mode displays an empty grid.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: LAZARUS 1.2.4 and UniDAC MSSQL access

Post by azyk » Mon 22 Sep 2014 12:53

Unfortunately we couldn't reproduce the problem. Please try to compose a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create and fill a tables.

Post Reply