Click here to Skip to main content
15,920,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disabling checkbox Pin
Dominik Reichl2-Jun-03 9:42
Dominik Reichl2-Jun-03 9:42 
GeneralRe: Disabling checkbox Pin
abc8762-Jun-03 9:56
abc8762-Jun-03 9:56 
GeneralRe: Disabling checkbox Pin
Dominik Reichl2-Jun-03 20:35
Dominik Reichl2-Jun-03 20:35 
GeneralRe: Disabling checkbox Pin
abc8762-Jun-03 9:50
abc8762-Jun-03 9:50 
QuestionHICON to HBITMAP? Pin
Dave_2-Jun-03 7:50
Dave_2-Jun-03 7:50 
AnswerRe: HICON to HBITMAP? Pin
Dominik Reichl2-Jun-03 8:43
Dominik Reichl2-Jun-03 8:43 
GeneralWinRTP and CE Pin
javigimenez2-Jun-03 6:53
javigimenez2-Jun-03 6:53 
GeneralProblem with SQLColumns in ODBC API Pin
insanely4202-Jun-03 6:48
insanely4202-Jun-03 6:48 
Greetings

I am writing an app to import data from an Access DB. I am fetching the information about columns of a table by using the following method -

SQLCHAR colname[SIZE_128+1]={0};
SQLINTEGER colsize=0;
SQLSMALLINT decimaldigit=0;

// allocate.
VERIFY ( (retcode = SQLAllocHandle ( SQL_HANDLE_STMT, sqlhdbc, &hstmt )) == SQL_SUCCESS );
retcode = SQLColumns ( hstmt, NULL, 0, NULL, 0, (SQLCHAR*)szTable, SQL_NTS, NULL, 0 );

if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {

/* Bind columns in result set to buffers */
SQLBindCol(hstmt, 4, SQL_C_CHAR, colname, SIZE_128, &size );
SQLBindCol(hstmt, 7, SQL_C_SLONG, &colsize, 0, &size );
SQLBindCol(hstmt, 9, SQL_C_SSHORT, &decimaldigit, 0, &decsize );

}

while( TRUE )
{
retcode = SQLFetch(hstmt);

if ( retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO ) {
// do stuff
} else {
break;
}
}


Now the problem is that even if a column is defined as DOUBLE in Access and has data like 2.345, 3.001, 0.0001 etc.
The decimaldigit is always returned with value 0. Therefore I am not able to get the correct decimal point for the column.

So instead of getting colsize = 15 and decimaldigit = 2, I am always getting colsize = 15 and decimaldigit = 0?

Am I doing something wrong?

Thanks in advance.

Karam
GeneralRe: Problem with SQLColumns in ODBC API Pin
David Crow2-Jun-03 7:17
David Crow2-Jun-03 7:17 
GeneralRe: Problem with SQLColumns in ODBC API Pin
insanely4202-Jun-03 8:13
insanely4202-Jun-03 8:13 
GeneralRe: Problem with SQLColumns in ODBC API Pin
Anonymous2-Jun-03 9:24
Anonymous2-Jun-03 9:24 
GeneralRe: Problem with SQLColumns in ODBC API Pin
basementman2-Jun-03 9:25
basementman2-Jun-03 9:25 
GeneralCLabel with tooltips Pin
doctorpi2-Jun-03 6:05
doctorpi2-Jun-03 6:05 
GeneralSilly question about repaint Pin
doctorpi2-Jun-03 6:00
doctorpi2-Jun-03 6:00 
GeneralRe: Silly question about repaint Pin
valikac2-Jun-03 6:46
valikac2-Jun-03 6:46 
GeneralRe: Silly question about repaint Pin
David Crow2-Jun-03 6:49
David Crow2-Jun-03 6:49 
GeneralRe: Silly question about repaint Pin
doctorpi2-Jun-03 7:00
doctorpi2-Jun-03 7:00 
GeneralRe: Silly question about repaint Pin
David Crow2-Jun-03 7:02
David Crow2-Jun-03 7:02 
GeneralRe: Silly question about repaint Pin
doctorpi2-Jun-03 7:09
doctorpi2-Jun-03 7:09 
GeneralRe: Silly question about repaint Pin
David Crow2-Jun-03 7:19
David Crow2-Jun-03 7:19 
GeneralCode to find cameras and scanners Pin
jleno2-Jun-03 5:55
jleno2-Jun-03 5:55 
GeneralRe: Code to find cameras and scanners Pin
Ryan_Roberts2-Jun-03 6:15
Ryan_Roberts2-Jun-03 6:15 
GeneralRe: Code to find cameras and scanners Pin
Andrew Walker2-Jun-03 13:42
Andrew Walker2-Jun-03 13:42 
GeneralCPropertySheet Pin
K. Shaffer2-Jun-03 5:54
K. Shaffer2-Jun-03 5:54 
GeneralRe: CPropertySheet Pin
Joan M2-Jun-03 6:02
professionalJoan M2-Jun-03 6:02 

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.