cancel
Showing results for 
Search instead for 
Did you mean: 

ODBC--call failed

DeepyaKakumanu
Level 2
Hi, I am trying to get data from MS Access into collection using code stage at that time I am facing an issue ODBC--call failed.


I am using the below code.

message="";
dt = new DataTable();
isSuccess=true;
string connStr= Connection_String;
OleDbConnection conn = new OleDbConnection(connStr);
OleDbDataAdapter objAdapter = new OleDbDataAdapter();
try{
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = Input_Query;
cmd.CommandTimeout=80000;
objAdapter.SelectCommand = cmd;
objAdapter.Fill(dt);
}
catch(Exception e)
{
isSuccess=false;
message+=e.Message+e.StackTrace;
}
finally{
conn.Close();
}

using the below connection string
Provider=Microsoft.ACE.OLEDB.12.0;Data Source= [FilePath] ;

Have any of you guys came across this type of issue. If yes, what should be done to avoid this issue.



------------------------------
Deepya Kakumanu
Program Analyst Trainee
Cognizant
------------------------------
1 REPLY 1

Have you tried using Data - OLEDB Business Object to connect MS Access. Provided by Blue Prism officially.
11673.png


But if you would like to use ODBC still.
I think in your post "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= [FilePath] ;", Look like your connection string is using for OLEDB instead of ODBC.
See also:
https://www.connectionstrings.com/microsoft-access-odbc-driver/
https://www.connectionstrings.com/access/

------------------------------
Pete Y
------------------------------