Click here to Skip to main content
15,915,860 members
Home / Discussions / Database
   

Database

 
AnswerRe: ORACLE Commit problem--- Error 8197 Pin
Arsene Cormier9-May-08 7:38
Arsene Cormier9-May-08 7:38 
GeneralRe: ORACLE Commit problem--- Error 8197 Pin
megha_gharote11-May-08 18:20
megha_gharote11-May-08 18:20 
GeneralDrop and Log Constraints Pin
Brady Kelly8-May-08 23:18
Brady Kelly8-May-08 23:18 
GeneralRe: Drop and Log Constraints Pin
Mycroft Holmes11-May-08 0:30
professionalMycroft Holmes11-May-08 0:30 
QuestionNeed Help with ADODB.Connection_InfoMessage Event in VB6 Pin
valkyriexp8-May-08 13:58
valkyriexp8-May-08 13:58 
AnswerRe: Need Help with ADODB.Connection_InfoMessage Event in VB6 Pin
Mycroft Holmes8-May-08 21:12
professionalMycroft Holmes8-May-08 21:12 
GeneralRe: Need Help with ADODB.Connection_InfoMessage Event in VB6 Pin
valkyriexp9-May-08 6:18
valkyriexp9-May-08 6:18 
AnswerRe: Need Help with ADODB.Connection_InfoMessage Event in VB6 Pin
valkyriexp9-May-08 10:35
valkyriexp9-May-08 10:35 
I found the Answer
the SQL command shall be enclose in a Begin...End and SET NOCOUNT ON shall be used.
so the SQL would be like

SQLAdd = " Begin SET NOCOUNT ON; DECLARE @Key int " & _
"SET @Key=(select (max(task_id)+1) from task) " & _
"insert into task (task_id,...)values (@Key ,...) " & _
" PRINT @Key; End"
I also tryed placing Select @Key at the end of the SQL command, but without Begin...End and SET NOCOUNT ON
rs.open SQLAdd will not actually open the recordset and any attempts to read the rs will result in Error Object Closed. But if you place Select @Key after the End, rs will contain the @key.

Arash
QuestionINFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Brady Kelly8-May-08 2:51
Brady Kelly8-May-08 2:51 
AnswerRe: INFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Mycroft Holmes8-May-08 21:22
professionalMycroft Holmes8-May-08 21:22 
GeneralRe: INFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Brady Kelly8-May-08 21:54
Brady Kelly8-May-08 21:54 
GeneralRe: INFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Mycroft Holmes8-May-08 22:07
professionalMycroft Holmes8-May-08 22:07 
GeneralRe: INFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Brady Kelly8-May-08 22:22
Brady Kelly8-May-08 22:22 
AnswerRe: INFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Rob Graham10-May-08 7:36
Rob Graham10-May-08 7:36 
GeneralRe: INFORMATION_SCHEMA.COLUMNS vs. sys.columns Pin
Brady Kelly11-May-08 10:31
Brady Kelly11-May-08 10:31 
QuestionNeed to Get a typical output Pin
Krazy Programmer7-May-08 23:49
Krazy Programmer7-May-08 23:49 
AnswerRe: Need to Get a typical output Pin
Ashfield8-May-08 0:06
Ashfield8-May-08 0:06 
QuestionWildCard search in SQL Server 2005? Pin
salon7-May-08 22:31
salon7-May-08 22:31 
AnswerRe: WildCard search in SQL Server 2005? Pin
salon7-May-08 22:47
salon7-May-08 22:47 
GeneralRe: WildCard search in SQL Server 2005? Pin
A Wong8-May-08 8:16
A Wong8-May-08 8:16 
GeneralRe: WildCard search in SQL Server 2005? Pin
salon8-May-08 18:18
salon8-May-08 18:18 
Questionhigh CPU utilization on the Oracle database server Pin
Ahmad Zuhd7-May-08 22:10
Ahmad Zuhd7-May-08 22:10 
Question[Message Deleted] Pin
Karan_TN7-May-08 21:58
Karan_TN7-May-08 21:58 
AnswerRe: deleting 1/1/1900 in SQL Server 2000 using Trigger? PinPopular
Christian Graus7-May-08 22:00
protectorChristian Graus7-May-08 22:00 
GeneralRe: deleting 1/1/1900 in SQL Server 2000 using Trigger? Pin
Karan_TN7-May-08 22:09
Karan_TN7-May-08 22:09 

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.