ODBC--call failed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-02-21 10:59 AM
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
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-02-21 02:06 AM
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
------------------------------
