CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Retrive Identity

Print topic Send  topic

Author Message
Rihn

Posts: 6
Posted: 03/29/2004, 10:59 AM

I have a form that when it loads I would like it to insert a row in my SQL database and returns the IDENTITY value to the input form when it loads. How can I call a stored proceedure to do this?
_________________
Harold Rihn
View profile  Send private message
peterr


Posts: 5971
Posted: 03/29/2004, 12:19 PM

Do you already have a Stored Procedure that does this?
I mean, is your question about how to return the IDENTITY value, or about how to call a Stored Procedure (regardless of what it does)?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Rihn

Posts: 6
Posted: 03/29/2004, 12:30 PM

Here is the sp code that I tried.

CREATE PROCEDURE [SDE],[myReptnum]
@Identity INT OUTPUT,
@ACC INT= NULL,
@species varchar[50] = null,
AS
INSERT INTO TESTTable1 [ACC,species] VALUES[NULL,NULL]
SELECT @@IDENTITY
RETURN @Identity
GO

This seems to add a row but I get nothing back when I tried to use the sp as the source for the form and the form has no buttons.
I tried to use a Before show action of Dlookup with no success either.
_________________
Harold Rihn
View profile  Send private message
peterr


Posts: 5971
Posted: 03/29/2004, 12:46 PM

This stored procedure doesn't look like could be used as a data source for a form since it only returns one field. It may be rather used to set the default value of a single field/control.

The DLookup function is used specifically to execute an SQL statement, but not to retrieve stored procedure values.

The right solution probably would be to call your SP from the "Before Show" event and then set the value of your field.

Calling a stored procedure may look differently in each programming language therefore please specify which lanugage you use (it is best to post such questions to the correct forum as we have one for each programming language).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/29/2004, 1:15 PM

Thanks for posting to Java forum. I actually don't know the answer in respect to Java, but will check into it (if no other users provide an answer).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.