Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Connection to MS Access Database Pin
David Crow1-Nov-04 6:27
David Crow1-Nov-04 6:27 
GeneralRe: Connection to MS Access Database Pin
WinAPILearner1-Nov-04 21:34
WinAPILearner1-Nov-04 21:34 
GeneralRe: Connection to MS Access Database Pin
David Crow2-Nov-04 2:30
David Crow2-Nov-04 2:30 
GeneralRe: Connection to MS Access Database Pin
David Crow2-Nov-04 7:48
David Crow2-Nov-04 7:48 
GeneralRe: Connection to MS Access Database Pin
David Crow2-Nov-04 8:04
David Crow2-Nov-04 8:04 
GeneralRe: Connection to MS Access Database Pin
WinAPILearner2-Nov-04 10:09
WinAPILearner2-Nov-04 10:09 
GeneralRe: Connection to MS Access Database Pin
David Crow2-Nov-04 10:24
David Crow2-Nov-04 10:24 
GeneralRe: Connection to MS Access Database Pin
WinAPILearner2-Nov-04 20:12
WinAPILearner2-Nov-04 20:12 
following is my implimentation
#include <windows.h>
#include <odbcinst.h>
#include <sqldb.h>
............ Other codes
void FillListBox (HWND hwndList)
{
SQLHENV henv;
SQLHDBC hdbc;
SQLHSTMT hstmt;
SQLRETURN retcode;
/*Allocate environment handle */
retcode = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {
/* Set the ODBC version environment attribute */
retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {
/* Allocate connection handle */
retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {
/* Set login timeout to 5 seconds. */
SQLSetConnectAttr(hdbc, (void*)SQL_LOGIN_TIMEOUT, 5, 0);
/* Connect to data source */
retcode = SQLConnect(hdbc, (SQLCHAR*) "TEST", SQL_NTS,
(SQLCHAR*) "tUser", SQL_NTS,
(SQLCHAR*) "tPass", SQL_NTS);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO){
/* Allocate statement handle */
retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {
/* Process data */
//SendMessage (hwndList, LB_ADDSTRING, 0, (LPARAM) "TEST") ;
SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
}
SQLDisconnect(hdbc);
}
SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
}
}
SQLFreeHandle(SQL_HANDLE_ENV, henv);
}


:\program files\microsoft visual studio\vc98\include\sqldb.h(56) : error C2143: syntax error : missing ')' before '*'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(56) : error C2143: syntax error : missing ';' before '*'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(56) : error C2059: syntax error : ')'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(56) : error C2061: syntax error : identifier 'PDBPROCESS'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(56) : error C2501: 'DBERRHANDLE_PROC' : missing storage-class or type specifiers
e:\program files\microsoft visual studio\vc98\include\sqldb.h(57) : error C2226: syntax error : unexpected type 'SQLAPI'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(59) : error C2146: syntax error : missing ';' before identifier 'SQLAPI'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(59) : error C2373: 'DBERRHANDLE_PROC' : redefinition; different type modifiers
e:\program files\microsoft visual studio\vc98\include\sqldb.h(56) : see declaration of 'DBERRHANDLE_PROC'
e:\program files\microsoft visual studio\vc98\include\sqldb.h(59) : fatal error C1004: unexpected end of file found
Error execu
GeneralRe: Connection to MS Access Database Pin
David Crow3-Nov-04 2:31
David Crow3-Nov-04 2:31 
GeneralRe: Connection to MS Access Database Pin
WinAPILearner3-Nov-04 7:42
WinAPILearner3-Nov-04 7:42 
GeneralRe: Connection to MS Access Database Pin
David Crow3-Nov-04 9:41
David Crow3-Nov-04 9:41 
GeneralConsole Threading Problem Pin
Joe_Sextus31-Oct-04 7:36
Joe_Sextus31-Oct-04 7:36 
GeneralRe: Console Threading Problem Pin
Ryan Binns31-Oct-04 17:57
Ryan Binns31-Oct-04 17:57 
GeneralRe: Console Threading Problem Pin
Joe_Sextus31-Oct-04 18:31
Joe_Sextus31-Oct-04 18:31 
GeneralRe: Operating System for Developers Pin
Christian Graus31-Oct-04 9:07
protectorChristian Graus31-Oct-04 9:07 
QuestionHow to hook system API under windows 9x? Pin
jedyking31-Oct-04 6:36
jedyking31-Oct-04 6:36 
AnswerRe: How to hook system API under windows 9x? Pin
User 665831-Oct-04 8:25
User 665831-Oct-04 8:25 
GeneralRe: How to hook system API under windows 9x? Pin
jedyking1-Nov-04 5:28
jedyking1-Nov-04 5:28 
AnswerRe: How to hook system API under windows 9x? Pin
ThatsAlok31-Oct-04 17:29
ThatsAlok31-Oct-04 17:29 
GeneralRe: How to hook system API under windows 9x? Pin
jedyking1-Nov-04 5:27
jedyking1-Nov-04 5:27 
GeneralTAPI givin link error Pin
asif m@hmood31-Oct-04 5:46
asif m@hmood31-Oct-04 5:46 
GeneralRe: TAPI givin link error Pin
Michael P Butler31-Oct-04 6:18
Michael P Butler31-Oct-04 6:18 
Questionhow to enable... Pin
Natural_Demon31-Oct-04 4:19
Natural_Demon31-Oct-04 4:19 
Generalpassin a variable from another class Pin
Natural_Demon31-Oct-04 4:13
Natural_Demon31-Oct-04 4:13 
GeneralRe: passin a variable from another class Pin
Christian Graus31-Oct-04 9:05
protectorChristian Graus31-Oct-04 9:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.