5 pts.
0
Q:
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?
ASKED: Mar 4 2009  6:24 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
29340 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Here is an example, using ODBC, and functions from sql.h

	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__);
}


Have a look at this MSDN document:

Developing Access 2007 Solutions with Native C or C++
Last Answered: Mar 4 2009  2:17 PM GMT by Carlosdl   29340 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0