Question

ODBC connection to Excel file and select data

  • 16 March 2022
  • 6 replies
  • 35 views

Badge +3

When I used ODBC to connect an Excel file and select data from excel file. I always get error say too few parameters expected 2

 

any one have same experience and can advise me?


6 replies

Userlevel 5
Badge +12

Hi @Mingshan Xu​ ,

 

Before DB Step can you keep a Message box and check whether you are getting values for FromDate and ToDate?

Badge +3

yes, it shows 2022-3-16 and 2022-3-21

Badge +3

even change data format also can not do, the error is same.

Badge +3

it is strange that last time this bot is working without problem

Userlevel 5
Badge +12

Hi @Mingshan Xu​ ,

 

Can you copy this query and try to hardcode the values in SSMS and try to execute? you will get lead if there is any format or syntactical error which is causing this issue in AA.

Userlevel 6
Badge +9

Hi @Mingshan Xu​ ,

 

The issue can be caused due to multiple reasons:

  1. If there is an error in Connecting database: it can be resolved by building the correct connection string.
  2. If there is an error in fetching the value from the column which contains space: It can be resolved by removing blank rows.

 

Also, as @ChanduMohammad S​  suggested you can always copy this query and try to hardcode the values in SSMS and try to execute. If there is any syntactical error that will be displayed there only.

 

Reply