|
|
|
Select из функции средствами ODBC
|
|||
|---|---|---|---|
|
#18+
Как сделать "select scope_identity()" средствами ODBC (я пользуюсь классом CDatabase)? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.11.2005, 13:18 |
|
||
|
Select из функции средствами ODBC
|
|||
|---|---|---|---|
|
#18+
Загляни в MSDN CDatabase::ExecuteSQL void ExecuteSQL( LPCSTR lpszSQL ); throw( CDBException ); Parameters lpszSQL Pointer to a null-terminated string containing a valid SQL command to execute. You can pass a CString. Remarks Call this member function when you need to execute an SQL command directly. Create the command as a null-terminated string. ExecuteSQL does not return data records. If you want to operate on records, use a recordset object instead. Most of your commands for a data source are issued through recordset objects, which support commands for selecting data, inserting new records, deleting records, and editing records. However, not all ODBC functionality is directly supported by the database classes, so you may at times need to make a direct SQL call with ExecuteSQL. Example Example Example Example Example Example /////////////////////////////////////////////////////////////// CString strCmd = "UPDATE Taxes SET Federal = 36%"; TRY { m_dbCust.ExecuteSQL( strCmd ); } CATCH(CDBException, e) { // The error code is in e->m_nRetCode } END_CATCH See Also CDatabase::SetLoginTimeout, CRecordset ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.11.2005, 15:28 |
|
||
|
Select из функции средствами ODBC
|
|||
|---|---|---|---|
|
#18+
В форуме MSSQL мне посоветовали использовать конструкцию Код: plaintext 1. 2. 3. для получения последнего кода id из автоинкрементного поля таблицы. Person Проблема в том, что я не знаю, как вернуть значение из метода CDatabase::ExecuteSQL(). Неужели мне придется создавать наследника СRecordset? Помогите плиз. У меня очень ограничены возможности инета. Не могу долго сидеть на msdn долго. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.11.2005, 17:05 |
|
||
|
|

start [/forum/topic.php?fid=57&fpage=384&tid=2032452]: |
0ms |
get settings: |
10ms |
get forum list: |
19ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
62ms |
get topic data: |
10ms |
get forum data: |
3ms |
get page messages: |
25ms |
get tp. blocked users: |
1ms |
| others: | 251ms |
| total: | 387ms |

| 0 / 0 |
