RobHVB6Sql
Programmer
(Using VB6 and SQL Server 7.0)
The stored procedure
--------------------
CREATE PROCEDURE spFamilyArchiveNeeded
(
@FamilyNo VARCHAR (8),
@NoToChangeDel INTEGER,
@retNeedsArchive INTEGER = NULL OUTPUT
)
AS
SELECT PersonID
FROM tblPerson
WHERE FamilyNo LIKE @FamilyNo
/* check if the change will remove the family number */
IF @@RowCount = @NoToChangeDel
BEGIN
SET @retNeedsArchive = 1
RETURN @retNeedsArchive
END
ELSE
BEGIN
SET @retNeedsArchive = 0
RETURN @retNeedsArchive
END
GO
===========================
Problem, what is the VB code to call and return this?
I would normally call this SP like this:
TheSQL = "EXEC spFamilyArchiveNeeded 'TEST005', 1, NULL"
Set adors = adoEnigmaConn.Execute(TheSQL)
Thanks in advance. Rob Hasard
Data Manager -Genetic Services
(VB6 /SQL 7.0)
The stored procedure
--------------------
CREATE PROCEDURE spFamilyArchiveNeeded
(
@FamilyNo VARCHAR (8),
@NoToChangeDel INTEGER,
@retNeedsArchive INTEGER = NULL OUTPUT
)
AS
SELECT PersonID
FROM tblPerson
WHERE FamilyNo LIKE @FamilyNo
/* check if the change will remove the family number */
IF @@RowCount = @NoToChangeDel
BEGIN
SET @retNeedsArchive = 1
RETURN @retNeedsArchive
END
ELSE
BEGIN
SET @retNeedsArchive = 0
RETURN @retNeedsArchive
END
GO
===========================
Problem, what is the VB code to call and return this?
I would normally call this SP like this:
TheSQL = "EXEC spFamilyArchiveNeeded 'TEST005', 1, NULL"
Set adors = adoEnigmaConn.Execute(TheSQL)
Thanks in advance. Rob Hasard
Data Manager -Genetic Services
(VB6 /SQL 7.0)