If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Brilliant Database > Query Works in 'Test Query' but not when used in the body of the program

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Location: Huntsville, AL
Posts: 256
Query Works in 'Test Query' but not when used in the body of the program

I have a query that is not running like it should. Within this query, under 'Actions', I have checked the box that says "Execute a script for each record". The scripting that pertains to this is only two lines long - the first line clears the current value from a field and the second line recalculates this field value. When I go to 'Test Query' it works perfectly. I have a variable set up in my main scripting (records from query). When I added some additional data to the program and ran the main code, it appears that the query is not actually running (this assumption is based on the fact that none of the records have been recalculated). Why is the query not running?

I did go back and add a third line of code to the query scripting - to 'Refresh' the newly updated field but nothing changes so I am not sure that the query is even running.

Tubbritt instructed me earlier on how to debug the queries but now I cannot even find the query in the 'Script Designer' - I can easily access them through the 'Query Editor' though... where did they go to?
Daryl G

Last edited by fireant911; 02-24-13 at 17:43.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Sep 2011
Location: Australia
Posts: 174
Not sure what is happing with out bbd file but when I have a script that is not performing as intended I insert mesage box(s) actions in different parts of script to see value of a variables (and if that section is actually being run). You could use the debug function but message box seems easier and so for always solved problem for me. One warning here - keep amount of test records under 10 or so unless you want to press ok a million times or crash program t o break out of any loops. If there is chance of a never ending loop try to add a if action that would break loop ( eg, IF Current Time > Now +60 seconds?).
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Location: Huntsville, AL
Posts: 256
tamicnd,
Is it possible to use something similar if one is curious about what is going on in a records from query. The 'test query' button produces the exactly what it is supposed to do; however, the problem I was having is that the query did not seem to be running properly when used in the body of the scripting itself.

I still cannot find the queries on the Debugging menu as I would like to step through them to see what is actually happening. I am certain that I saw them earlier when James Tubritt before instructed me where to look but I cannot see any of them now???
Daryl G
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On