Discussion:
Dialog.Update(table) does not work
(too old to reply)
schrei
2007-05-22 11:05:10 UTC
Permalink
Hello,

I made a simple sql database program.
On the form i inserted a SqlControls.Table object, which i linked to
a 'table:SqlDB.Table' Object.

If i do a test, the result of a sql select statment, has no effect to
the SqlControl object on the form. But if i delete and insert the
SqlControl on the form again, the SqlControl works.

Do i make something wrong, or is that a bug?

Here the source code:

MODULE Test;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB, SqlControls;

VAR statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)

PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, pwd, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := "";
database := "Test Database";
driver := SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver,id,pwd,database,SqlDB.async,SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table);
END Execute;

BEGIN
END Test.

Yours sincerely
Helmut
Josef Templ
2007-05-23 07:14:36 UTC
Permalink
are you sure?
It works perfectly for me.
I have tried it under BB 1.6 RC and BB 1.5.

BTW, in case you post an example please also include
the GUI rsrc file.

- JT
Post by schrei
Hello,
I made a simple sql database program.
On the form i inserted a SqlControls.Table object, which i linked to
a 'table:SqlDB.Table' Object.
If i do a test, the result of a sql select statment, has no effect to the
SqlControl object on the form. But if i delete and insert the SqlControl
on the form again, the SqlControl works.
Do i make something wrong, or is that a bug?
MODULE Test;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB, SqlControls;
VAR statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)
PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, pwd, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := "";
database := "Test Database";
driver := SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver,id,pwd,database,SqlDB.async,SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table); END Execute;
BEGIN
END Test.
Yours sincerely
Helmut
heli
2007-05-23 17:32:43 UTC
Permalink
Post by Josef Templ
are you sure?
It works perfectly for me.
I have tried it under BB 1.6 RC and BB 1.5.
BTW, in case you post an example please also include
the GUI rsrc file.
- JT
Post by schrei
Hello,
I made a simple sql database program.
On the form i inserted a SqlControls.Table object, which i linked to
a 'table:SqlDB.Table' Object.
If i do a test, the result of a sql select statment, has no effect to the
SqlControl object on the form. But if i delete and insert the SqlControl
on the form again, the SqlControl works.
Do i make something wrong, or is that a bug?
MODULE Test;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB, SqlControls;
VAR statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)
PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, pwd, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := "";
database := "Test Database";
driver := SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver,id,pwd,database,SqlDB.async,SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table); END Execute;
BEGIN
END Test.
Yours sincerely
Helmut
thanks for the answer!
I tried it also with BB 1.6 and 1.5

After a restart of BB and reload of the GUI, each executed select
returns no records in the SQLControl. But if i close the GUI and open
the GUI again, the records are displayed immediately.

This is the GUI:

StdCoder.Decode ..,, ..XH....
3Qw7uP5PRPPNR9Rbf9b8R79FTvMf1GomCrlAy2xhX,Cb2x

hXhC6FU1xhiZiVBhihgmRiioedhgrZcZRiXFfaqmSrtuGfa4700zdGrr8rmCLLCJuyKtYcZRiX
7.2.s,6O7.,k,
5TWyql.bnayKmKKqGomC5XzET1.PuP.MHT9N9ntumaU2,CJuyKtQC98P9PP7O
NbXmb.2.oq1k2ELD.,6.,U0eFTfQPfJHPNCbHZiYpedhgrZ6MwBuPZ1QCh0708T,U..w.
2f1U.
2U1eFTfQqorG4bndMHT9N9HWUl1UnNHEWUmr.
6.gh0E3km8.,6.,.3oVyKrIijZhnpZEhin3h0
hioZijph2hgnRAXzE.QcjphoV2hgnFtD.
2.e32.822U2Q7HntY89ntYCRlW2D9nlgi.YC9H.gc
.2DQA.,E.0.U,.,6EnM.0oA4UURy9M13P08ssD2ktMMV9RHvPR9F91u.
2.842.e22U2.Y8QCd1
bHuAAd1PnmoBd1bHu...,.U,.,kLqU.B1WrjPVEah1cUXzE.ocdhggZg2hgn,E.
6I6.6C6.G.E
ektYCR,AAkq.E..U,.,kL6.99,WquyYrpv7cUCJuGqdCKtyKqmqm8rtuGf.
2.5.0.33D.J2,6.

8cHBigRcjpho,Gpk8KqKKWKqtMwbOQN1.5uPU2,Z50E..Ud.,kZaqtGpmCLuuGu4Klma.U..I3
,DX1.0.2eHJ.
6...z,nQv2sJY,xftTGbLL92E0.cUO2Coru4YBoZHZC5uPR1EWKqt2Ulr6..bf
95uP.Y62.5011Z1cQ...sQR,.G20EtH.0..M0E.I.
6.3M.Vfl2cNk0U.M.E.ErnOcobww03Qw7
0.50..h.0..2,2..2kLRCNN65J.nT32kwL,,sKFHKHGA,YV1...
--- end of encoding ---

And here the source module:

MODULE KisTest;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB,
SqlControls, Log;

VAR
statement*: ARRAY 1024 OF CHAR;

table*: SqlDB.Table; (* anchor for database *)

PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, password, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := ""; database := "Test Database"; driver :=
"SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver, id, password, database,SqlDB.async,
SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table);
END Execute;

BEGIN

END KisTest.

Yours sincerely
Helmut
Josef Templ
2007-05-23 17:39:23 UTC
Permalink
aaah, you are using 'async' mode.
Don't use it. It makes everything much more
complicated and in 99.9 % it is not required at all.

- JT
Post by heli
Post by Josef Templ
are you sure?
It works perfectly for me.
I have tried it under BB 1.6 RC and BB 1.5.
BTW, in case you post an example please also include
the GUI rsrc file.
- JT
Post by schrei
Hello,
I made a simple sql database program.
On the form i inserted a SqlControls.Table object, which i linked to
a 'table:SqlDB.Table' Object.
If i do a test, the result of a sql select statment, has no effect to the
SqlControl object on the form. But if i delete and insert the SqlControl
on the form again, the SqlControl works.
Do i make something wrong, or is that a bug?
MODULE Test;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB, SqlControls;
VAR statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)
PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, pwd, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := "";
database := "Test Database";
driver := SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver,id,pwd,database,SqlDB.async,SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table); END Execute;
BEGIN
END Test.
Yours sincerely
Helmut
thanks for the answer!
I tried it also with BB 1.6 and 1.5
After a restart of BB and reload of the GUI, each executed select
returns no records in the SQLControl. But if i close the GUI and open
the GUI again, the records are displayed immediately.
StdCoder.Decode ..,, ..XH....
3Qw7uP5PRPPNR9Rbf9b8R79FTvMf1GomCrlAy2xhX,Cb2x
hXhC6FU1xhiZiVBhihgmRiioedhgrZcZRiXFfaqmSrtuGfa4700zdGrr8rmCLLCJuyKtYcZRiX
7.2.s,6O7.,k,
5TWyql.bnayKmKKqGomC5XzET1.PuP.MHT9N9ntumaU2,CJuyKtQC98P9PP7O
NbXmb.2.oq1k2ELD.,6.,U0eFTfQPfJHPNCbHZiYpedhgrZ6MwBuPZ1QCh0708T,U..w.
2f1U.
2U1eFTfQqorG4bndMHT9N9HWUl1UnNHEWUmr.
6.gh0E3km8.,6.,.3oVyKrIijZhnpZEhin3h0
hioZijph2hgnRAXzE.QcjphoV2hgnFtD.
2.e32.822U2Q7HntY89ntYCRlW2D9nlgi.YC9H.gc
.2DQA.,E.0.U,.,6EnM.0oA4UURy9M13P08ssD2ktMMV9RHvPR9F91u.
2.842.e22U2.Y8QCd1
bHuAAd1PnmoBd1bHu...,.U,.,kLqU.B1WrjPVEah1cUXzE.ocdhggZg2hgn,E.
6I6.6C6.G.E
ektYCR,AAkq.E..U,.,kL6.99,WquyYrpv7cUCJuGqdCKtyKqmqm8rtuGf.
2.5.0.33D.J2,6.
8cHBigRcjpho,Gpk8KqKKWKqtMwbOQN1.5uPU2,Z50E..Ud.,kZaqtGpmCLuuGu4Klma.U..I3
,DX1.0.2eHJ.
6...z,nQv2sJY,xftTGbLL92E0.cUO2Coru4YBoZHZC5uPR1EWKqt2Ulr6..bf
95uP.Y62.5011Z1cQ...sQR,.G20EtH.0..M0E.I.
6.3M.Vfl2cNk0U.M.E.ErnOcobww03Qw7
0.50..h.0..2,2..2kLRCNN65J.nT32kwL,,sKFHKHGA,YV1...
--- end of encoding ---
MODULE KisTest;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB,
SqlControls, Log;
VAR
statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)
PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, password, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := ""; database := "Test Database"; driver :=
"SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver, id, password, database,SqlDB.async,
SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table);
END Execute;
BEGIN
END KisTest.
Yours sincerely
Helmut
heli
2007-05-23 18:53:07 UTC
Permalink
Post by Josef Templ
aaah, you are using 'async' mode.
Don't use it. It makes everything much more
complicated and in 99.9 % it is not required at all.
- JT
Post by heli
Post by Josef Templ
are you sure?
It works perfectly for me.
I have tried it under BB 1.6 RC and BB 1.5.
BTW, in case you post an example please also include
the GUI rsrc file.
- JT
Post by schrei
Hello,
I made a simple sql database program.
On the form i inserted a SqlControls.Table object, which i linked to
a 'table:SqlDB.Table' Object.
If i do a test, the result of a sql select statment, has no effect to
the
SqlControl object on the form. But if i delete and insert the
SqlControl
on the form again, the SqlControl works.
Do i make something wrong, or is that a bug?
MODULE Test;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB, SqlControls;
VAR statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)
PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, pwd, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := "";
database := "Test Database";
driver := SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver,id,pwd,database,SqlDB.async,SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table); END Execute;
BEGIN
END Test.
Yours sincerely
Helmut
thanks for the answer!
I tried it also with BB 1.6 and 1.5
After a restart of BB and reload of the GUI, each executed select
returns no records in the SQLControl. But if i close the GUI and open
the GUI again, the records are displayed immediately.
StdCoder.Decode ..,, ..XH....
3Qw7uP5PRPPNR9Rbf9b8R79FTvMf1GomCrlAy2xhX,Cb2x
hXhC6FU1xhiZiVBhihgmRiioedhgrZcZRiXFfaqmSrtuGfa4700zdGrr8rmCLLCJuyKtYcZRiX
7.2.s,6O7.,k,
5TWyql.bnayKmKKqGomC5XzET1.PuP.MHT9N9ntumaU2,CJuyKtQC98P9PP7O
NbXmb.2.oq1k2ELD.,6.,U0eFTfQPfJHPNCbHZiYpedhgrZ6MwBuPZ1QCh0708T,U..w.
2f1U.
2U1eFTfQqorG4bndMHT9N9HWUl1UnNHEWUmr.
6.gh0E3km8.,6.,.3oVyKrIijZhnpZEhin3h0
hioZijph2hgnRAXzE.QcjphoV2hgnFtD.
2.e32.822U2Q7HntY89ntYCRlW2D9nlgi.YC9H.gc
.2DQA.,E.0.U,.,6EnM.0oA4UURy9M13P08ssD2ktMMV9RHvPR9F91u.
2.842.e22U2.Y8QCd1
bHuAAd1PnmoBd1bHu...,.U,.,kLqU.B1WrjPVEah1cUXzE.ocdhggZg2hgn,E.
6I6.6C6.G.E
ektYCR,AAkq.E..U,.,kL6.99,WquyYrpv7cUCJuGqdCKtyKqmqm8rtuGf.
2.5.0.33D.J2,6.
8cHBigRcjpho,Gpk8KqKKWKqtMwbOQN1.5uPU2,Z50E..Ud.,kZaqtGpmCLuuGu4Klma.U..I3
,DX1.0.2eHJ.
6...z,nQv2sJY,xftTGbLL92E0.cUO2Coru4YBoZHZC5uPR1EWKqt2Ulr6..bf
95uP.Y62.5011Z1cQ...sQR,.G20EtH.0..M0E.I.
6.3M.Vfl2cNk0U.M.E.ErnOcobww03Qw7
0.50..h.0..2,2..2kLRCNN65J.nT32kwL,,sKFHKHGA,YV1...
--- end of encoding ---
MODULE KisTest;
IMPORT Dialog, Views, TextModels, TextControllers, SqlDB,
SqlControls, Log;
VAR
statement*: ARRAY 1024 OF CHAR;
table*: SqlDB.Table; (* anchor for database *)
PROCEDURE Execute*;
VAR res: INTEGER; db: SqlDB.Database;
id, password, database, driver: ARRAY 32 OF CHAR;
BEGIN
id := ""; password := ""; database := "Test Database"; driver :=
"SqlOdbc3";
IF table = NIL THEN
SqlDB.debug:=TRUE;
SqlDB.OpenDatabase(driver, id, password, database,SqlDB.async,
SqlDB.showErrors,db,res);
table := db.NewTable();
END;
table.Exec(statement);
Dialog.Update(table);
END Execute;
BEGIN
END KisTest.
Yours sincerely
Helmut
thank you very much
Helmut

Continue reading on narkive:
Loading...