Skip to main content
Question

Unable to use variable when connecting to database


  • Navigator | Tier 3
  • 13 replies

it seems I am unable to include variables (red box) while connecting to a database within a loop. Anyone have a work around?

 

SQL Loop 

msg box file path displayed below

 

FILE PATH DISPLAY

6 replies

Ashwin A.K
Forum|alt.badge.img+8
  • Navigator | Tier 3
  • 2445 replies
  • February 2, 2022

Hi @Steven chev​ ,

 

Could you try displaying that filepath in a message box, just to see if there are any issues with it?

 

Kind Regards,

Ashwin A.K


Forum|alt.badge.img+19
  • Most Valuable Pathfinder
  • 2694 replies
  • February 2, 2022

Hi @Steven chev​ ,

 

We can use the variables, as Ashwin suggested can you check the path in a message box and let us know the result?


  • Author
  • Navigator | Tier 3
  • 13 replies
  • February 2, 2022

Hi @ChanduMohammad S​ 

 

Thanks for chiming in. I have uploaded the results in the post above.


  • Author
  • Navigator | Tier 3
  • 13 replies
  • February 2, 2022

Hi @Ashwin A.K​ 

 

Thank you for you response.

 

I have uploaded the photo of the message box to this thread

 

It looks only 1/3 of the variables are displayed in the msg box. The $Filename$.$Extension$ are the two that are not displayed.

 

Any suggestions?

 

msg box 

see below of error message when running line 2

 

error msg


Ashwin A.K
Forum|alt.badge.img+8
  • Navigator | Tier 3
  • 2445 replies
  • February 3, 2022

Hi @Steven chev​ ,

 

Could you verify whether the folder which you are iterating through contains files other that the excel files you wish to interact with?

 

Try this, add an If Command and only connect to Excel if the $Extension$ = xlsx.

That ought to do the trick.

 

Kind Regards,

Ashwin A.K


Forum|alt.badge.img+19
  • Most Valuable Pathfinder
  • 2694 replies
  • February 3, 2022

Hi @Steven chev​ ,

 

This is the issue, check why the values are not getting passed correctly to this variable you will get connected to the Database.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings