ADO : errors when Open(L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\AccessExampleDB.mdb",L"",L

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
my codes as follows:
_ConnectionPtr m_pConnection;<br/>
try<br/>
{<br/>
HRESULT hr = m_pConnection.CreateInstance("ADODB.Connection");<br/>
if(SUCCEEDED(hr))<br/>
{
hr = m_pConnection->Open(L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\AccessExampleDB.mdb",L"",L"",adModeReadWrite);<br/>
}<br/>
else<br/>
{<br/>
AfxMessageBox(L"Create Connection Object Failure!");<br/>
}<br/>
}<br/>
catch(_com_error e)<br/>
{<br/>
CString errormessage;<br/>
errormessage.Format(L"linking AccessExampleDB Failure!n Tips:%s",e.ErrorMessage());<br/>
AfxMessageBox(errormessage);<br/>
}

using the codes, i cant link to the "AccessExampleDB(E:\AccessExampleDB.mdb) "; please help me !
Thanks!
Merry Christmas !

View the full article
 
Back
Top