Question

Using MS Access to get data table, nothing happens

  • 17 December 2022
  • 5 replies
  • 54 views

Badge +1

Hello everyone…

I´ve just started learning and using AA so any help would be much appreciated, I really don´t understand what I´m missing!

I´m following a tutorial and using MS Access to pull information to a data table, then show a box message with the info… When I run the bot it doesn't give me an error, it just says completed and close, clearly skipping the box message part. 

I don´t know where the error is… is it the connection? the select statement? For the connection I tried both default and user defined, either way the result is the same. Regarding the select statement, I´ve tried a few but no change. Here is what I have so far:

 


5 replies

Userlevel 3
Badge +6

Dear @Laouns,

 

You are trying to use Access Automation (AA) to retrieve data from an Access database and display it in a message box. There could be a few reasons why the message box is not being displayed. Here are some things to consider:

  1. Make sure that the message box code is being executed. One way to do this is to add a debug message before and after the message box code, to see if the code is being reached.

  2. Check the syntax of the message box code. Make sure that you are using the correct syntax for the message box function in your programming language.

  3. Check the return value of the message box function. Some message box functions return a value indicating the button that was clicked, so make sure that you are handling this return value correctly.

  4. Make sure that the data being retrieved from the database is being stored in a variable that can be accessed by the message box code.

Regards,

Userlevel 7
Badge +11

Hi @Laouns ,

 

As per the image shown, the message box is within the loop. If you are not getting that message box means, BOT is not even going inside that loop.

If I am not mistaken, the SELECT query normally using before starting a loop. Here it is mentioned inside your loop and technically, there is nothing for the BOT to loop through.

 

 

Badge +1

Hi @Laouns ,

 

As per the image shown, the message box is within the loop. If you are not getting that message box means, BOT is not even going inside that loop.

If I am not mistaken, the SELECT query normally using before starting a loop. Here it is mentioned inside your loop and technically, there is nothing for the BOT to loop through.

 

 

Hello! Thank you for the suggestion! I´ll try again and see if this has anything to do with it… but I´´ve tried to run all the sequence outside the loop but is still a flop. 

Badge +1

Dear @Laouns,

 

You are trying to use Access Automation (AA) to retrieve data from an Access database and display it in a message box. There could be a few reasons why the message box is not being displayed. Here are some things to consider:

  1. Make sure that the message box code is being executed. One way to do this is to add a debug message before and after the message box code, to see if the code is being reached.

  2. Check the syntax of the message box code. Make sure that you are using the correct syntax for the message box function in your programming language.

  3. Check the return value of the message box function. Some message box functions return a value indicating the button that was clicked, so make sure that you are handling this return value correctly.

  4. Make sure that the data being retrieved from the database is being stored in a variable that can be accessed by the message box code.

Regards,

Hello @Zaibi.. Thank you very much for your response. I will check all your suggestions to determine if the error is in the database or the message box! This will definitely help me narrow down the issue. 

Userlevel 7
Badge +11

Hi @Laouns ,

 

As per the image shown, the message box is within the loop. If you are not getting that message box means, BOT is not even going inside that loop.

If I am not mistaken, the SELECT query normally using before starting a loop. Here it is mentioned inside your loop and technically, there is nothing for the BOT to loop through.

 

 

Hello! Thank you for the suggestion! I´ll try again and see if this has anything to do with it… but I´´ve tried to run all the sequence outside the loop but is still a flop. 

 

Based on your logic in the above screenshot, you have begun the transaction and immediately started the loop. But technically, there is nothing available for the Bot to loop through. 

 

Try putting only the Export action above that loop and within that action itself, you have an option to export the result to a CSV file. Try generating that CSV file and see whether you are getting any data within it or not.

Reply