Hi
We have an application that runs fine on SQL 2000. Due to other applications we are forced to move to SQL 2005.
One Stored Procedure isn't working on the new SQL 2005. It's a SP with output parameters and a recordset. It's working fine on SQL 2000.
The data is returned through OLEDB to a VB6 application. In this application the output parameters are working fine (can access them). But the recordset isn't working. Both EOF en BOF are true...
Executing the SP from SQL Server Management Studio works fine.
Is it not allow to have output parameters and a recordset anymore? Or is the code different?
I hope you can help...
Below is the SP and the VB6 code: -
ALTER PROCEDURE [dbo].[ADM_LS_SelectUserPassword]
-
@UserName varchar(16),
-
@UserID int OUTPUT,
-
@UserPassword varchar(16) OUTPUT,
-
@UserNickname varchar(16) OUTPUT,
-
@UserErrCount smallint OUTPUT,
-
@UserLastname varchar(32) OUTPUT,
-
@Expired int OUTPUT
-
AS
-
BEGIN
-
SET NOCOUNT ON;
-
-
DECLARE @ExpireDate smalldatetime,@PWChanged smalldatetime
-
-
-
SELECT distinct @UserNickname = PAEm_Nickname, @UserLastname = PAEm_Lastname, @UserPassword = PAEm_Password, @UserID = PAEm_ID, @UserErrCount = PAEm_ErrCount,@PWChanged = PAEm_PWLastChanged
-
FROM ADM_PA_Employee, ADM_PA_CntrGlobal
-
WHERE PAEm_Username = @Username and PACG_FK_PAEm_ID = PAEm_ID and (PACg_Enddate > dateadd(day,-1,getdate()) or PACg_Enddate is null)
-
-
--Kijken en instellen of het wachtwoord niet is verlopen
-
SET @ExpireDate = DATEADD(mm,CONVERT(int,(SELECT CMPa_Value FROM ADM_CM_PARAMETERS WHERE CMPa_Code = 'PWExpire')),@PWChanged)
-
IF @ExpireDate < getdate() SET @Expired = 1
-
ELSE SET @Expired = 0
-
-
IF @UserPassword != ''
-
begin
-
if isnull(@UserNickname,'') = ''
-
SELECT @UserNickname = PAEm_Firstname
-
FROM ADM_PA_Employee
-
WHERE PAEm_Username = @Username
-
end
-
-
-
IF @UserID > 0
-
SELECT distinct sysobjects.name
-
FROM sysobjects, sysprotects, sysusers, ADM_LS_Groups, ADM_LS_EmployeeGroups, ADM_PA_Employee
-
WHERE xtype = 'P'
-
and sysobjects.id = sysprotects.id
-
and sysprotects.uid = sysusers.uid
-
and (sysprotects.protecttype = 204 or sysprotects.protecttype = 205)
-
and LSGr_Login = sysusers.name
-
and LSGr_ID = LSEG_FK_LSGr_ID
-
and LSEG_FK_PAEm_ID = PAEm_ID
-
and PAEm_ID = @UserID
-
ORDER BY sysobjects.nameELSE
-
SELECT * FROM ADM_PA_Employee WHERE PAEm_ID = 1 and PAEm_ID = 2
-
END
-
-
dbCom.CommandText = "ADM_LS_SelectUserPassword"
-
dbCom.CommandType = adCmdStoredProc
-
dbCom.Parameters.Refresh
-
-
dbCom(1).Value = strUserName
-
-
dbRst.Open dbCom
-
-
- If dbRst.EOF = True Or dbRst.BOF = True Then
-
dbRst.Close
-
If Not IsNull(dbCom(2).Value) Then
-
Err.Raise 1004, , "User has no permissions: " & strUserName
-
Else
-
Err.Raise 1000, , "Unknown user: " & strUserName
-
End If
-
Else
-
ReDim strGroup(0)
-
Do While Not dbRst.EOF
-
ReDim Preserve strGroup(UBound(strGroup) + 1)
-
strGroup(UBound(strGroup) - 1) = dbRst.Fields(0)
-
dbRst.MoveNext
-
Loop
-
dbRst.Close
-
End If
-
1 16693
A little update.
So it seems that the issue is not related to the return values and recordset.
I have created a small test application which returns a recordset just fine.
Could it be possible that SQL 2005 prevents information from sysobject to be exported (using SQL)?
I have this in a stored procedure where I fetch a list of stored procedures where a user has rights: -
SELECT distinct sysobjects.name
-
FROM sysobjects, sysprotects, sysusers, ADM_LS_Groups, ADM_LS_EmployeeGroups, ADM_PA_Employee
-
WHERE xtype = 'P'
-
and sysobjects.id = sysprotects.id
-
and sysprotects.uid = sysusers.uid
-
and (sysprotects.protecttype = 204 or sysprotects.protecttype = 205)
-
and LSGr_Login = sysusers.name
-
and LSGr_ID = LSEG_FK_LSGr_ID
-
and LSEG_FK_PAEm_ID = PAEm_ID
-
and PAEm_ID = @UserID
-
ORDER BY sysobjects.name
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Vipul Pathak |
last post by:
Hello Friends !
I have the Following Code, that Executes a Stored Procedure and Attempt to
read a Returned Integer Value from the StoredProc.
But It gives Error ...
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/C4U/DBOutputParameterTest.asp, line 25
|
by: JT |
last post by:
how can i see a stored procedures return value in ASP??
|
by: sumGirl |
last post by:
Hi all. I have a stored procedure on my sql server that returns a
simple informtation about that tim a database was backed up. I owuld
like to create an HTA that operator types can look at to make sure
that the backups finished, can someone help me do this?
The stored procedure in called sp_lastback and the output looks like
this:
database days since backup timestamp of backup
dbase1 0 2004-10-14 00:41:21.000
|
by: Daniel |
last post by:
hi ng,
i am newbie to sqlserver and my problem seems simple, but i didn't find
information about it:
How can i display the
RETURN @x
value of a stored procedure in the sql analyzer of the sqlserver?
thanks a lot,
d
|
by: stjulian |
last post by:
I have a stored procedure which returns 2 tables and 1 output value. I want
the first table to be assigned to rs1 and the second to rs2. However when I
run this, I get the following error as I begin to refer to the rs2 recordset
(Do while not rs2.eof). I have even used 2 ".execute" statements in the code
below, but the code assigns the first recordset twice.
Microsoft VBScript runtime error '800a01a8'
Object required: 'rs2'
...
| |
by: colmkav |
last post by:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
Set Cmd = New Command
With Cmd
Set .ActiveConnection = get_XE_Conn 'makes a connection
Oracle XE
|
by: Dooza |
last post by:
I have a stored procedure that takes a number of inputs, does a bulk
insert, and then outputs a recordset. When I run the stored procedure in
Server Management Studio I also get a return value from the stored
procedure which is an INT.
I want to access this return value on my ASP/VBScript page, but do not
know how to access it.
Here is my code so far:
|
by: SethM |
last post by:
I have a stored procedure that returns a record set. I want to
functionalize this so I can have multiple presentations of the same
record set. However, I can not get rs_event.open StoreProc to pass
through the function, so I can use rs_event("Title"), etc, etc. Is
this possible to do? If so how? Thanks.
Regards,
Seth
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |