Click here to Skip to main content
15,897,518 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Increment of Alphabetic nos(A to Z) Pin
C1AllenS8-May-08 18:54
C1AllenS8-May-08 18:54 
AnswerRe: Increment of Alphabetic nos(A to Z) Pin
darkelv8-May-08 19:27
darkelv8-May-08 19:27 
GeneralRe: Increment of Alphabetic nos(A to Z) Pin
CPallini8-May-08 22:20
mveCPallini8-May-08 22:20 
GeneralRe: Increment of Alphabetic nos(A to Z) Pin
darkelv8-May-08 22:35
darkelv8-May-08 22:35 
QuestionNeed Help with ADODB.Connection_InfoMessage Event in VB6 Pin
valkyriexp8-May-08 14:00
valkyriexp8-May-08 14:00 
AnswerRe: Need Help with ADODB.Connection_InfoMessage Event in VB6 Pin
Dave Kreskowiak9-May-08 1:42
mveDave Kreskowiak9-May-08 1:42 
GeneralRe: Need Help with ADODB.Connection_InfoMessage Event in VB6 Pin
valkyriexp9-May-08 6:06
valkyriexp9-May-08 6:06 
AnswerRe: Need Help with ADODB.Connection_InfoMessage Event in VB6 Pin
valkyriexp9-May-08 10:41
valkyriexp9-May-08 10:41 
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
QuestionMinimizing a windows application. Pin
dptalt8-May-08 10:25
dptalt8-May-08 10:25 
AnswerRe: Minimizing a windows application. Pin
Smithers-Jones8-May-08 10:44
Smithers-Jones8-May-08 10:44 
Questionspecifying autocad version when opened by my vb application Pin
OlaMohammed8-May-08 10:21
OlaMohammed8-May-08 10:21 
AnswerRe: specifying autocad version when opened by my vb application Pin
Dave Kreskowiak8-May-08 10:31
mveDave Kreskowiak8-May-08 10:31 
GeneralRe: specifying autocad version when opened by my vb application Pin
OlaMohammed10-May-08 3:07
OlaMohammed10-May-08 3:07 
Questionsql server Pin
bapu28898-May-08 9:52
bapu28898-May-08 9:52 
AnswerRe: sql server Pin
Dave Kreskowiak8-May-08 10:20
mveDave Kreskowiak8-May-08 10:20 
QuestionRe: sql server Pin
bapu28899-May-08 9:01
bapu28899-May-08 9:01 
AnswerRe: sql server Pin
Dave Kreskowiak9-May-08 13:54
mveDave Kreskowiak9-May-08 13:54 
QuestionRe: sql server Pin
bapu288910-May-08 7:29
bapu288910-May-08 7:29 
AnswerRe: sql server Pin
Dave Kreskowiak10-May-08 9:07
mveDave Kreskowiak10-May-08 9:07 
QuestionRe: sql server Pin
bapu288910-May-08 23:12
bapu288910-May-08 23:12 
QuestionDisappearing custom CommandBar menu in Excel Pin
dsimms8-May-08 8:05
dsimms8-May-08 8:05 
Questionfread() equivalent in VB? Pin
Phyxion8-May-08 7:49
Phyxion8-May-08 7:49 
AnswerRe: fread() equivalent in VB? Pin
Tim Carmichael8-May-08 7:56
Tim Carmichael8-May-08 7:56 
GeneralRe: fread() equivalent in VB? Pin
Phyxion8-May-08 8:08
Phyxion8-May-08 8:08 
AnswerRe: fread() equivalent in VB? Pin
Phyxion8-May-08 9:26
Phyxion8-May-08 9:26 

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.