Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disabling dialog button from within the ON_BN_CLICKED handler Pin
toxcct24-Mar-05 2:24
toxcct24-Mar-05 2:24 
GeneralRe: Disabling dialog button from within the ON_BN_CLICKED handler Pin
24-Mar-05 3:21
suss24-Mar-05 3:21 
GeneralRe: Disabling dialog button from within the ON_BN_CLICKED handler Pin
Daniele Godi29-Mar-05 23:05
Daniele Godi29-Mar-05 23:05 
GeneralRe: Disabling dialog button from within the ON_BN_CLICKED handler Pin
Member 52815523-Mar-05 22:22
Member 52815523-Mar-05 22:22 
GeneralRe: Disabling dialog button from within the ON_BN_CLICKED handler Pin
qrverona24-Mar-05 2:19
qrverona24-Mar-05 2:19 
Generaldll signature. Pin
oustar23-Mar-05 21:42
oustar23-Mar-05 21:42 
GeneralRe: dll signature. Pin
gP_t_gr823-Mar-05 22:16
gP_t_gr823-Mar-05 22:16 
QuestionHow to obtain the inserted row's ID (database) Pin
Abyss23-Mar-05 21:22
Abyss23-Mar-05 21:22 
Hi,

I try to get the inserted row's ID (primary key) which was inserted to a table.
I tried the following API calls immediately after insert. I use the same m_hStmn for the insert and the select query.

This call is successfull however when I query the returned value using the SQLFetch and SQLGetData the returned SQLINTEGER is always zero!?
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT @@IDENTITY AS 'Ident'"), SQL_NTS)

I tried to use the more save SCOPE_IDENTITY() function, however these API calls fail.
The driver returns (for Access table) undefined function.
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT SCOPE_IDENTITY()"), SQL_NTS)<br />
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT SCOPE_IDENTITY() As [Ident]"), SQL_NTS)


In this case I got from the driver one parameter missing error code:
SQLExecDirect(m_hStmn, (SQLTCHAR*)_T("SELECT SCOPE_IDENTITY"), SQL_NTS)

Can anybody explain how can I correctly get the inserted row's ID? Why the above calls
fail Cry | :(( ?

Thanks,
Abyss
GeneralExport Member function / class Pin
Steve Messer23-Mar-05 21:15
Steve Messer23-Mar-05 21:15 
GeneralRe: Export Member function / class Pin
David Crow24-Mar-05 5:43
David Crow24-Mar-05 5:43 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 7:01
Steve Messer24-Mar-05 7:01 
GeneralRe: Export Member function / class Pin
cmk24-Mar-05 8:34
cmk24-Mar-05 8:34 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 8:41
Steve Messer24-Mar-05 8:41 
GeneralRe: Export Member function / class Pin
cmk24-Mar-05 10:17
cmk24-Mar-05 10:17 
GeneralRe: Export Member function / class Pin
cmk24-Mar-05 10:24
cmk24-Mar-05 10:24 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 13:21
Steve Messer24-Mar-05 13:21 
GeneralRe: Export Member function / class Pin
cmk24-Mar-05 20:49
cmk24-Mar-05 20:49 
GeneralRe: Export Member function / class Pin
Steve Messer25-Mar-05 5:25
Steve Messer25-Mar-05 5:25 
GeneralRe: Export Member function / class Pin
Steve Messer25-Mar-05 9:51
Steve Messer25-Mar-05 9:51 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 19:11
Steve Messer24-Mar-05 19:11 
GeneralRe: Export Member function / class Pin
David Crow24-Mar-05 8:38
David Crow24-Mar-05 8:38 
GeneralRe: Export Member function / class Pin
Steve Messer24-Mar-05 13:27
Steve Messer24-Mar-05 13:27 
GeneralDundas OXMultiComboBox crashes Pin
Bernhard23-Mar-05 20:01
Bernhard23-Mar-05 20:01 
Questionado can not run when WinXP update to sp2? Pin
Lido Paul23-Mar-05 19:54
Lido Paul23-Mar-05 19:54 
QuestionEnd of file? Pin
sacoskun23-Mar-05 19:49
sacoskun23-Mar-05 19:49 

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.