5 pts.
 Database connectivity between Microsoft Access and C++
how can i give database connectivity in code of c++, and my database is stored in ms-access?

Software/Hardware used:
ASKED: March 4, 2009  6:24 AM
UPDATED: March 4, 2009  2:17 PM

Answer Wiki:
Here is an example, using ODBC, and functions from sql.h <pre> SQLHENV henv; SQLHDBC hdbc; SQLRETURN rc; SQLCHAR server[12]; SQLCHAR uid[12]; SQLCHAR pwd[12]; . . . strcpy((char*)server, "test_db"); strcpy((char*)uid, "Admin"); strcpy((char*)pwd, ""); SDWORD cbName = SQL_NTS; if (((rc = SQLAllocEnv(&henv)) == SQL_SUCCESS) && ((rc = SQLAllocConnect(henv, &hdbc)) == SQL_SUCCESS)) { if ((rc = SQLConnect(hdbc, server, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS)) != SQL_SUCCESS) print_error (henv, hdbc, SQL_NULL_HSTMT, rc, __LINE__, __FILE__); } else { print_error (henv, SQL_NULL_HDBC, SQL_NULL_HSTMT, rc, __LINE__, __FILE__); } </pre> Have a look at this MSDN document: <a href="http://msdn.microsoft.com/en-us/library/cc811599.aspx">Developing Access 2007 Solutions with Native C or C++</a>
Last Wiki Answer Submitted:  March 4, 2009  2:17 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _