Click here to Skip to main content
16,010,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralButtom order Pin
26-Jul-01 2:36
suss26-Jul-01 2:36 
GeneralRe: Buttom order Pin
Tomasz Sowinski26-Jul-01 2:47
Tomasz Sowinski26-Jul-01 2:47 
Generali ment: buttom border Pin
26-Jul-01 3:51
suss26-Jul-01 3:51 
GeneralRe: i ment: buttom border Pin
Tomasz Sowinski26-Jul-01 4:12
Tomasz Sowinski26-Jul-01 4:12 
GeneralRichEdit Pin
26-Jul-01 2:17
suss26-Jul-01 2:17 
GeneralRe: RichEdit Pin
Tomasz Sowinski26-Jul-01 2:55
Tomasz Sowinski26-Jul-01 2:55 
GeneralRe: RichEdit Pin
26-Jul-01 2:56
suss26-Jul-01 2:56 
QuestionHow to read parameter from stored procedure ? Pin
Bartek26-Jul-01 2:09
Bartek26-Jul-01 2:09 
Hi,

I am using ADO tecnology to execute stored procedure.

Does anyone know how to read out a parameter from sp into VC++ variable

I need to get @file_id (which is set at the bottom of sp)
thank you,
bartek

My stored procedure:

CREATE PROCEDURE [sp_StandardFileNew]
@receive_date varchar(20),
@pj_id int,
@pj_type varchar(20),
@file_group varchar(200),
@name varchar(255),
@ext varchar(10),
@total_words int,
@dtp_pages int,
@notes varchar(500)


AS

DECLARE @file_id int,
@receive_date2 smalldatetime,
@project_id int,
@job_id int,
@group_id int

-- Check if obligatory text parameters are null

if @name is null OR @ext is null OR @pj_id is null OR @pj_type is null OR @receive_date is null
begin
return 1
end

-- Set @project_id or @job_id depending on the @pj_type [ "job" | "project" ]

if @pj_type="job" begin
set @project_id=null
set @job_id=@pj_id
end else if @pj_type="project" begin
set @project_id=@pj_id
set @job_id=null
end else begin
return 2
end

-- Check group_txt if it exists retrieve its id or create new group if it does not exist

if @file_group is not null begin
exec sp_NewFileGroup @file_group, null, @project_id, @job_id, @group_id OUTPUT
if @group_id is null begin
return 3
end
end else begin
set @group_id = null
end

-- Convert date-string format to datetime / smalldatetime

exec sp_DateConvert @receive_date, @receive_date2 OUTPUT

-- insert new row to the Files table and convert text arguments to integer values

insert into files(name, ext, receive_date, group_id, job_id, project_id, total_words, dtp_pages, file_type_id, deleted, works_count, notes)
values(@name, @ext, @receive_date2, @group_id, @job_id, @project_id, @total_words, @dtp_pages, 0, 0, 0, @notes)

set @file_id = @@identity

if @file_id is null begin
return 4
end

return 0
GO
GeneralWANTED: Clever Ideas Pin
Derek Lakin26-Jul-01 1:59
Derek Lakin26-Jul-01 1:59 
GeneralRe: WANTED: Clever Ideas Pin
Tomasz Sowinski26-Jul-01 3:01
Tomasz Sowinski26-Jul-01 3:01 
GeneralRe: ON_UPDATE_COMMAND_UI Pin
Derek Lakin26-Jul-01 5:20
Derek Lakin26-Jul-01 5:20 
GeneralRe: ON_UPDATE_COMMAND_UI Pin
George Chastain26-Jul-01 5:34
George Chastain26-Jul-01 5:34 
GeneralRe: WM_KICKIDLE Pin
Derek Lakin26-Jul-01 21:15
Derek Lakin26-Jul-01 21:15 
GeneralRe: ON_UPDATE_COMMAND_UI Pin
Tomasz Sowinski26-Jul-01 6:41
Tomasz Sowinski26-Jul-01 6:41 
GeneralDrawing Icons on Buttons Pin
Derek Lakin26-Jul-01 1:54
Derek Lakin26-Jul-01 1:54 
GeneralRe: Drawing Icons on Buttons Pin
Steve Thresher26-Jul-01 5:51
Steve Thresher26-Jul-01 5:51 
GeneralRe: ILC_MASK Pin
Derek Lakin26-Jul-01 21:16
Derek Lakin26-Jul-01 21:16 
GeneralDialog design Pin
26-Jul-01 1:44
suss26-Jul-01 1:44 
QuestionWhat is type: something** ? Pin
26-Jul-01 1:44
suss26-Jul-01 1:44 
AnswerRe: What is type: something** ? Pin
Derek Lakin26-Jul-01 1:47
Derek Lakin26-Jul-01 1:47 
GeneralRe: What is type: something** ? Pin
Derek Waters26-Jul-01 16:50
Derek Waters26-Jul-01 16:50 
GeneralRe: What is type: something** ? Pin
Sam C26-Jul-01 17:34
Sam C26-Jul-01 17:34 
GeneralRe: What is type: something** ? Pin
Derek Waters26-Jul-01 18:30
Derek Waters26-Jul-01 18:30 
GeneralRe: What is type: something** ? Pin
Sam C26-Jul-01 19:42
Sam C26-Jul-01 19:42 
QuestionSQL ? Pin
otvac26-Jul-01 1:39
otvac26-Jul-01 1:39 

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.