Source language: Translate to:

Strange behavior

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Strange behavior

Postby smartmedia » Tue Feb 19, 2008 7:04 am

Hi...

Is not the first time that i am talking about strange behavior in DBPPro.
Example:
Code: Select all
dbpAddRecord "Test" "Usr"
SetVar "[Test.Usr.id]" "[Quiz.id]"
SetVar "[Test.Usr.QuestionNum]" "[Quiz.QuestionNum]"
SetVar "[Test.Usr.Question]" "[Quiz.Question]"
SetVar "[Test.Usr.RightAnwser]" "[Quiz.RightAnswer]"
SetVar "[Test.Usr.Answered]" "[J6I9L]"

If "[Quiz.RightAnswer]" "=" "[J6I9L]"
SetVar "[Test.Usr.State]" "Σωστό"
else
SetVar "[Test.Usr.State]" "Λάθος"
endif

dbpSaveEdits "Test" "Usr"
SetVar "[Test.Quiz.Answered]" "Yes"
dbpSaveEdits "Test" "Quiz"


if i run this code once, the [Test.Quiz.Answered] with "Yes" inside isn't saved to record.
if the code in the last 3 lines and run again then is saved.
Very strange.

If i change the order like this:

Code: Select all
dbpAddRecord "Test" "Usr"
SetVar "[Test.Usr.id]" "[Quiz.id]"
SetVar "[Test.Usr.QuestionNum]" "[Quiz.QuestionNum]"
SetVar "[Test.Usr.Question]" "[Quiz.Question]"
SetVar "[Test.Usr.RightAnwser]" "[Quiz.RightAnswer]"
SetVar "[Test.Usr.Answered]" "[J6I9L]"

If "[Quiz.RightAnswer]" "=" "[J6I9L]"
SetVar "[Test.Usr.State]" "Σωστό"
else
SetVar "[Test.Usr.State]" "Λάθος"
endif

SetVar "[Test.Quiz.Answered]" "Yes"
dbpSaveEdits "Test" "Quiz"
dbpSaveEdits "Test" "Usr"


The changes in [Test.Quiz.Answered] are saved.

Also i am facing lot's of problem's working with access database and my feeling is that the plugin
is not communicate 100% with odbc or any other releative componets.

Example:

dbpEmptyTable "Test" "Quiz"
Is not working in Access, instead, dbpDeleteAll "Test" "Usr" is working nice.

Also running the following code, not all the times gives me this error "Key column information is insufficient or incorrect. To many rows where affected by update".

Code: Select all
if "[Test.$Status]" "=" "Connected"
dbpCloseDatabase "Test"
endif

FileOpenBox "Άνοιγμα Test" "Any File|*.test" "[PubDir]" "[S8J9LP]" ""

if "[S8J9LP]" ">" ""
dbpOpenAccessDatabase "Test" "[S8J9LP]" ""
dbpOpenTable "Test" "Quiz" ""
dbpOpenTable "Test" "Usr" ""
dbpOpenTable "Test" "Information" ""
dbpSort "Test" "Usr" "QuestionNum=ASC"
dbpExecSQL "Test" "UPDATE Quiz SET Answered='No';" ""
dbpDeleteAll "Test" "Usr"
SetVar "[Quiz.$RecCount]" "[Test.Quiz.$RecCount]"
SetVar "[Usr.$RecCount]" "[Test.Usr.$RecCount]"
dbpSetFieldProperties "Test" "Usr" "QuestionNum" "Alignment=Center;
TitleAlignment=Left"
dbpSetFieldProperties "Test" "Usr" "Answered" "Alignment=Center;
TitleAlignment=Left"
dbpSetFieldProperties "Test" "Usr" "RightAnwser" "Alignment=Center;
TitleAlignment=Left"
dbpSetColumnOrder "Test" "Quiz" "QuestionNum;Question"
dbpSetColumnWidths "Test" "Quiz" "QuestionNum=40;Question=680"
dbpSetGridProperties "Test" "Quiz" "Color=Window;Font=Tahoma,9,
Normal,GREEK_CHARSET;FontColor=WindowText;AlternateRowColor=253,249,217;
AlternateRowFontColor=WindowText;RowHeight=30;TitleColor=BtnFace;
TitleFont=Tahoma,9,Normal,ANSI_CHARSET;TitleFontColor=183,91,0;
TitleRowHeight=30;HighlightColor=139,173,254;HighlightFontColor=HighlightText;
EditColor=Window;EditFontColor=WindowText;ShowTitles=No;
3DTitles=No;ShowGraphics=Yes;ShowIndicator=No;
ShowColumnLines=Yes;ShowRowLines=Yes;GridLineWidth=1;
GridLineColor=BtnFace;AllowRowResize=No;AllowColumnResize=No;
AllowColumnSort=Yes;ConfirmDelete=No;ReadOnly=Yes;
RowSelect=Yes;ShowScrollBars=Yes;ShowNavigationBar=No;OnDoubleClick="
dbpShowGrid "Test" "Quiz" "Rectangle8"

dbpSetColumnTitles "Test" "Usr" "id=id;QuestionNum=Νο ερώτησης;Question=Ερώτηση;RightAnwser=Σωστή απάντηση;Answered=Απαντήθηκε;State=Κατάσταση"
dbpSetColumnOrder "Test" "Usr" "QuestionNum;Question;
RightAnwser;
Answered;State"
dbpSetColumnWidths "Test" "Usr" "id=60;QuestionNum=60;Question=430;RightAnwser=60;Answered=60;State=65"
dbpSetGridProperties "Test" "Usr" "Color=Window;Font=Tahoma,10,Normal,GREEK_CHARSET;FontColor=WindowText;
AlternateRowColor=253,249,217;AlternateRowFontColor=WindowText;RowHeight=70;
TitleColor=BtnFace;TitleFont=Tahoma,9,Normal,ANSI_CHARSET;
TitleFontColor=Black;TitleRowHeight=40;HighlightColor=139,173,254;
HighlightFontColor=HighlightText;EditColor=Window;
EditFontColor=WindowText;
ShowTitles=Yes;3DTitles=Yes;ShowGraphics=Yes;ShowIndicator=No;
ShowColumnLines=No;ShowRowLines=Yes;GridLineWidth=0;
GridLineColor=BtnFace;AllowRowResize=No;AllowColumnResize=No;
AllowColumnSort=No;ConfirmDelete=No;ReadOnly=Yes;RowSelect=Yes;
ShowScrollBars=Yes;ShowNavigationBar=No;OnDoubleClick=WatchAnswer"
dbpShowGrid "Test" "Usr" "Rectangle1"
endif


Dave, can you check if something is wrong with the communication of DBPro and Access or ODBC.
Can someone confirm it or reject it...???
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Tue Feb 19, 2008 1:17 pm

We beta tested DBPro for weeks and weeks, to determine exactly that. As far as I know it works correctly, but we're operating through something called ADO which is a generic interface designed to work with a variety of database engines - not just MS Access. Ninety-Five percent of the code in DBPro is generic, designed to work with any ADO compatible database.

As I have done many, many times in the past, I am more than happy to assist you in debugging your publications. Several changes and fixes have been made to DBPro as a result of your input. Unfortunately, I don't have time to recreate the conditions where your publication fails from scratch. The code you have supplied here does not provide me with anything I can test.

What I need from you is a very simple sample publication and database that includes just the minimum code required to reproduce the problem. If I have to sift through a 20-30 page pub to find a bug, my chances of success will be significantly reduced.

Creating a small sample publication is an excellent exercise that can sometimes actually solve the problem by exposing errors in logic, typos, etc. If it turns out that there is a bug in DBPro then that can be fixed, but it's absolutely critical that we reduce the problem down to its smallest possible elements.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Thu Feb 28, 2008 1:44 am

Hi...

Dave, i know how difficult is to spend your valuable hours debugging other's project.
After making much tests with debugging step, i have find out that the message:
"Key column information is insufficient or incorrect. To many rows where affected by update"
comes from dbpDeleteAll command. Is not happening every time i use the code but very often, 1 to 5 times.

That gives me the inpression that in general way Delete all or Empty table is routine is not wokring 100%. Can you take a look in that...???
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Thu Feb 28, 2008 4:00 pm

That's good information. I'll look at the dbpDeleteAll action and see if I can reproduce the problem. In the mean time, you might try using SQL to delete all records from your tables instead. For example:

DELETE * FROM table_name
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest

cron