Quotenames

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jlund
Posts: 22
Joined: Wed 17 Nov 2004 18:50

Quotenames

Post by jlund » Mon 20 Jun 2011 11:44

Hi

I am having trouble switching between SQL server and MySQL.

If I connect using MySQL, work on som tables, Close the connection, and then try to connect to at SQL server using the same TUniTable and TUniConnection, UniDac still uses the ` char to quote the table-, and fieldnames insted of [], and vice versa.

If I close the program and restart, there is no problem.


I am using SDac 3.00.0.2

TIA Jens Lund

AndreyZ

Post by AndreyZ » Mon 20 Jun 2011 13:41

Hello,

Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. As soon as we resolve the problem, we will let you khow.
As a workaround, you can clear (or change to another value) the TUniTable.TableName property between connections to different database servers. Here is a code example:

Code: Select all

procedure TMainForm.BitBtn1Click(Sender: TObject);
begin
  UniConnection.LoginPrompt := False;
  UniTable.Connection := UniConnection;
  UniTable.Options.QuoteNames := True;
  UniConnection.ProviderName := 'SQL Server';
  UniConnection.Server := 'server';
  UniConnection.Database := 'database';
  UniConnection.Username := 'username';
  UniConnection.Password := 'password';
  UniTable.TableName := 'test';
  UniTable.Open;
  UniConnection.Close;
  UniConnection.ProviderName := 'MySQL';
  UniConnection.Server := 'server';
  UniConnection.Database := 'database';
  UniConnection.Username := 'username';
  UniConnection.Password := 'password';
  UniTable.TableName := '';
  UniTable.TableName := 'test';
  UniTable.Open;
end;

jlund
Posts: 22
Joined: Wed 17 Nov 2004 18:50

Post by jlund » Mon 20 Jun 2011 13:55

Thank you very much for the swift reply :)

/Jens Lund

AndreyZ

Post by AndreyZ » Thu 23 Jun 2011 13:24

We have fixed this problem. This fix will be included in the next UniDAC build.

Post Reply