provider cannot be found. it may not be properly installed

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
<span style="color:blue public <span style="color:blue static
<span style="color:#2B91AF DataTable GetDataTable(<span style="color:blue string strFileName)
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
{
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
ADODB.<span style="color:#2B91AF Connection oConn = <span style="color:blue
new ADODB.<span style="color:#2B91AF Connection();
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
oConn.Open(<span style="color:#A31515 "Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.<span style="color:#2B91AF Path.GetDirectoryName(strFileName) +
<span style="color:#A31515 "; Extended Properties = "Text;HDR=YES;FMT=Delimited";",
<span style="color:#A31515 "", <span style="color:#A31515 "", 0);
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
<span style="color:green //oConn.Open("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + "System.IO.Path.GetFileName(strFileName)" + "Extended Properties=" + "text;HDR=Yes;FMT=Delimited";", "", "", 0);
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
<span style="color:blue string strQuery = <span style="color:#A31515
"SELECT * FROM [" + System.IO.<span style="color:#2B91AF Path.GetFileName(strFileName) +
<span style="color:#A31515 "]";
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
ADODB.<span style="color:#2B91AF Recordset rs = <span style="color:blue
new ADODB.<span style="color:#2B91AF Recordset();
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
System.Data.OleDb.<span style="color:#2B91AF OleDbDataAdapter adapter =
<span style="color:blue new System.Data.OleDb.<span style="color:#2B91AF OleDbDataAdapter();
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
<span style="color:#2B91AF DataTable dt = <span style="color:blue
new <span style="color:#2B91AF DataTable();
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
rs.Open(strQuery, <span style="color:#A31515 "Provider=Microsoft.Jet.OleDb.4.0; Data Source = " + System.IO.<span style="color:#2B91AF Path.GetDirectoryName(strFileName) +
<span style="color:#A31515 "; Extended Properties = "Text;HDR=YES;FMT=Delimited";",
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
ADODB.<span style="color:#2B91AF CursorTypeEnum.adOpenForwardOnly, ADODB.<span style="color:#2B91AF LockTypeEnum.adLockReadOnly, 1);
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
adapter.Fill(dt, rs);
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
<span style="color:blue return dt;
<p style="margin-bottom:0in; margin-bottom:.0001pt; line-height:normal; text-autospace:none
<span style="font-family:Times New Roman,serif <span>
}
<span style="font-family:Times New Roman,serif
<span style="font-family:Times New Roman,serif provider cannot be found. it may not be properly installed
<span style="font-family:Times New Roman,serif
<span style="font-family:Times New Roman,serif NOTICE:<span>
I booth of these (one commented out for each run):
<span style="font-family:Times New Roman,serif; color:#A31515 Microsoft.Jet.OleDb.4.0
<span style="font-family:Times New Roman,serif; color:green Microsoft.ACE.OLEDB.12.0

I did install the ACE Driver; it made no difference. Can someone offer a solution, or is this just a waste of time. Basically, Im just fiddling around with some C# projects that I found online. This one has me stumped.

Thanks everyone!!! <hr class="sig Ryan Shuell

View the full article
 
Back
Top