You could call the sp with a seeded value of 0 for the output parameter, if
you're getting a problem with the execution of the stored procedure.
Also, your code probably needs to look more like this:
> Actually I already get an error at the cmd1.Execute line, saying that the
> But why would I supply it? It's an output parameter... not an input
> Running the stored procedure stand-alone (outside code) executes
> successfully after asking me for the 5 input parameters (not 6) and
> "Procedure executed successfully but did not return any records", and
> the record is inserted.
> -- Hans
> > What I'm trying to do is insert a record and return the new record's
> > key value (school_review_id)
> > This is the stored procedure:
> > Alter Procedure "sp_create_school_review"
> > As
> > INSERT tbl_SRI (district_review_id, school_id, review_status,
> > review_status_date, selection_status)
> > VALUES (
> > )
> > Return
> > And here is the Access code that calls it:
> > Dim str_sp as string
> > Dim new_school_review_id as long
> > str_sp = "sp_create_school_review (58, 213, 2, '3/15/2001', -1)"
> > Set cmd1 as New ADODB.Command
> > cmd1.ActiveConnection = CurrentProject.Connection
> > cmd1.CommandType = adCmdStoredProc
> > cmd1.CommandText = str_sp
> > cmd1.Execute
> > new_school_review_id = cmd1("new_school_review_id")
> > cmd1 = Nothing
> > Whhat I would expect is that new_school_review_id will contain the
> > parameter's value, but instead I get an error: "Data Provider or other
> > Service returned an E_FAIL status"
> > How should I properly do what I'm trying to do?
> > -- Hans