It is all contained in the link from your question.
You have to decide which method you want to use:
- Direct DAO (Win32)
- ATL OLE DB (ATL/MFC)
- ADO (Win32)
- Direct ODBC (Win32)
- MFC ODBC (MFC)
The Win32 methods require importing of a DLL which might be a bit tricky to avoid name conflicts.
Depending on the used method it might be necessary to ship additional packages with your application to ensure that the used database interface is installed on the client (Microsoft Access Redistributables or MDAC which should be present with all recent Windows versions since Vista/7).
See also the notes about 32/64 bit. If possible build a 32-bit application.
DAO provides the best support (more functions than the other methods). When using MFC, there are classes for OLE DB and ODBC which reduces the amount of code to write.
If you got stuck with a specific method, ask again or update your question with a short code example and a detailed problem description. "Not work" does not mean anything to us; especially when not having a single piece of code and an error message.
[EDIT: For code posted meanwhile]
If a function returns some kind of status / error, check that and report errors immediately. Your code snippet does not do that for all functions and reports errors sometimes after calling other function meanwhile. Read also the documentation for the used function to know which parameters has to be passed.
You have also to follow the examples regarding the order of the functions to be called:
- Create a _ConnectionPtr
- Open the connection
- Create a RecordsetPtr
- Open the recordset passing the connection
In detail:
pRstAuthors->Open("SELECT* FROM Customers","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\\Sankar\\Database1.accdb",adOpenStatic,adLockReadOnly, adCmdText);
is not a valid call. It misses passing the connection. It must be:
pRstAuthors->Open("SELECT* FROM Customers","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\\Sankar\\Database1.accdb",
_variant_t((IDispatch *) pConnection, true),
adOpenStatic,
adLockReadOnly,
adCmdText);
[/EDIT]