Not Able To Connect To CSV File Using Database-> Connect Activity For ODBC Connection

How to resolve error while connecting to CSV file from Studio Connect activity using ODBC connection?

In order to use database activity, first connection string needs to be defined. Connection string contains how to connect to the database from the engine side.

If the use of String.Format is unfamiliar, the {0} will be swapped with the second argument which is databaseFileDirectory. The key is this value specified for databaseFileDirectory is not the file itself, but the folder where file of interest is stored.

String.Format(“Provider=Microsoft.Jet.OLEDB.4.0; Data Source=”"{0}""; Extended Properties="“text;HDR=NO;FORMAT=Delimited”"",databaseFileDirectory)

The file of interest is specified at query time.
String.Format(“SELECT * FROM [{0}]”,“test.csv”)

Please refer to the sample in UiPath forum : https://forum.uipath.com/t/working-with-csv-with-database-activities/322973

1 Like