#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <stdio.h>
void main(void)
{
SQLHENV henv;
SQLHDBC hdbc;
SQLRETURN nstatus;
SQLCHAR szConnect[1024];
SQLSMALLINT cbConnString;
for(int k =0;k<500;k++)
{
nstatus = SQLAllocHandle(SQL_HANDLE_ENV,NULL,&henv);
nstatus = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3,0);
nstatus = SQLAllocHandle(SQL_HANDLE_DBC,henv,&hdbc);
nstatus = SQLDriverConnect(hdbc,NULL,
(SQLCHAR*) "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\Program Files\\Microsoft Visual Studio\\VB98\\NWIND.MDB",
SQL_NTS, szConnect, 1024, &cbConnString, SQL_DRIVER_NOPROMPT);
nstatus = SQLDisconnect(hdbc);
nstatus = SQLFreeHandle(SQL_HANDLE_DBC,hdbc);
nstatus = SQLFreeHandle(SQL_HANDLE_ENV,henv);
}
printf("Done");
}