#1 2018-04-12 08:01:46

danny
Member
Registered: 2016-08-02
Posts: 13

TSQLSettings.CreateAndFillPrepare issue question

Hello,
I have created 3 tables and next, for example:
   

Settings := TSQLSettings.CreateAndFillPrepare(Client, 'LogonName LIKE ?', [ALogonName]);
    FileSettings := TSQLFileSettings.CreateAndFillPrepare(Client, 'LogonName LIKE ? AND FileVersion LIKE ?', [ALogonName, AVersion]);
    TerminationSettings := TSQLTerminationSettings.CreateAndFillPrepare(Client, 'LogonName LIKE ?', [ALogonName]);

and later iterate:

if Settings.FillOne then
      begin
        ....
      end;

while FileSettings.FillOne do
      begin
        ........
      end;

 while TerminationSettings.FillOne do
      begin    
       .......
        end;
      end;

Issue is that - only Settings and FileSettings are iterated....
TerminationSettings is not iterate - 'TSQLTerminationSettings.CreateAndFillPrepare' return NIL (table nil).
In SQLite database file TerminationSettings table have created....
What is wrong?

Best regards.

Last edited by danny (2018-04-12 08:06:02)

Offline

#2 2018-04-12 08:40:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: TSQLSettings.CreateAndFillPrepare issue question

1. Look at the logs (after enabling the verbose mode) and check the SELECT statement and what it returns.
2. Use the debugger to trace the execution.

Offline

#3 2018-04-12 21:37:25

danny
Member
Registered: 2016-08-02
Posts: 13

Re: TSQLSettings.CreateAndFillPrepare issue question

Hmmm I have searched a lot of time and I suposse guilty is AuthGroup:
User:   14,1-3,6-256,0,1-3,6-256,0,1-3,6-256,0,1-3,6-256,0

The order of the columns is a magical unknown to me, even after reading the documentation....
I created sql tables in proper order...

Offline

#4 2018-04-12 21:40:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: TSQLSettings.CreateAndFillPrepare issue question

Perhaps you changed the class order in the TSQLModel...

Offline

#5 2018-04-12 22:04:50

danny
Member
Registered: 2016-08-02
Posts: 13

Re: TSQLSettings.CreateAndFillPrepare issue question

Maybe yes maybe no smile I dont remember, but...

I have deleted sqlite db, and created again with TSQLModel and the same tables configuration (3 tables in the same order).
In SQLite DB have been created 5 tables:  Users and Groups i 3 of my tables.
Problem were still existed...

Solution was a change range in AuthGroups for User by hand..., but is normal way? I dont think so smile

Offline

#6 2018-04-13 08:07:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: TSQLSettings.CreateAndFillPrepare issue question

I don't know what you did with the users.

Offline

#7 2018-04-13 08:51:02

danny
Member
Registered: 2016-08-02
Posts: 13

Re: TSQLSettings.CreateAndFillPrepare issue question

I have nothing done with Users. I swear smile. I am using User account with standard password for test purpose only.

maybe it was incident, but I was confused and it took me a long time to deal with this problem.

Last edited by danny (2018-04-13 08:52:12)

Offline

Board footer

Powered by FluxBB