dbTalk Databases Forums  

sp_password problems, ASE12.51 via ado-oledb from win app

comp.databases.sybase comp.databases.sybase


Discuss sp_password problems, ASE12.51 via ado-oledb from win app in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Anders Arvidsson
 
Posts: n/a

Default sp_password problems, ASE12.51 via ado-oledb from win app - 09-02-2004 , 04:12 AM






I have some issues with my allowing the user to change their own
passwords from the win-client app I'm stuck with. I've encapsulated
the sp_password call in a stored procedure of my own for some
additional rules and checks. Yet at the end of the day, even if
everything executes fine I don't get a recordset back to extract the
result from.

My hunch is that it is connected to the "Password correctly set." that
is raised.

I'm on ASE12.51 using the Sybase OLEDB and ado on the winclient app.

Hints, tips or solutions?

//
Anders

Reply With Quote
  #2  
Old   
Jim Douglas
 
Posts: n/a

Default Re: sp_password problems, ASE12.51 via ado-oledb from win app - 09-02-2004 , 06:30 AM






Have our wrapper code check the results of the change by SELECT -1 or SELECT
1 depending on success, then you should get something back from the OLEDB
provider that you can use.

"Anders Arvidsson" <aon (AT) home (DOT) se> wrote

Quote:
I have some issues with my allowing the user to change their own
passwords from the win-client app I'm stuck with. I've encapsulated
the sp_password call in a stored procedure of my own for some
additional rules and checks. Yet at the end of the day, even if
everything executes fine I don't get a recordset back to extract the
result from.

My hunch is that it is connected to the "Password correctly set." that
is raised.

I'm on ASE12.51 using the Sybase OLEDB and ado on the winclient app.

Hints, tips or solutions?

//
Anders



Reply With Quote
  #3  
Old   
Anders Arvidsson
 
Posts: n/a

Default Re: sp_password problems, ASE12.51 via ado-oledb from win app - 09-03-2004 , 03:35 AM



I'm already doing that. My hunch is that MS's ADO are the cause of my
problems.

Basically in my trouble shooting effort I stripped down the SP to have
the call to sp_password and then evaluate the return value and @@error
and depending on the outcome end the procedure with a SELECT <some
return value>.

My wrapper checks for the first value in the first column in the
recordset, but I just get :
-2146825023 (0x800A0CC1) Remote ADO Error: Could not find the object
in the collection corresponding to the requested name or ordinal
reference.

I've tried running my wrapper procedure via ADO explorer just to see
how the return recordset looks like there, and there I don't get a
recordset back at all. It just gives me a Success statement, but no
recordset.

Running it the statement in isql gives a correct result, though. My
hunch is that the "Password correctly set." statement that sp_password
raises puts a stick in my wheel.

//

Anders



"Jim Douglas" <james.douglas (AT) genesis-software (DOT) com> wrote

Quote:
Have our wrapper code check the results of the change by SELECT -1 or SELECT
1 depending on success, then you should get something back from the OLEDB
provider that you can use.

Reply With Quote
  #4  
Old   
Jim Douglas
 
Posts: n/a

Default Re: sp_password problems, ASE12.51 via ado-oledb from win app - 09-04-2004 , 03:14 AM



Maybe the deal is that the SP is using "RETURN" vs "SELECT". I have seen
that before, change the SP to explicity use as the final good/bad select
"SELECT 1" or bad "SELECT -1"

"Anders Arvidsson" <aon (AT) home (DOT) se> wrote

Quote:
I'm already doing that. My hunch is that MS's ADO are the cause of my
problems.

Basically in my trouble shooting effort I stripped down the SP to have
the call to sp_password and then evaluate the return value and @@error
and depending on the outcome end the procedure with a SELECT <some
return value>.

My wrapper checks for the first value in the first column in the
recordset, but I just get :
-2146825023 (0x800A0CC1) Remote ADO Error: Could not find the object
in the collection corresponding to the requested name or ordinal
reference.

I've tried running my wrapper procedure via ADO explorer just to see
how the return recordset looks like there, and there I don't get a
recordset back at all. It just gives me a Success statement, but no
recordset.

Running it the statement in isql gives a correct result, though. My
hunch is that the "Password correctly set." statement that sp_password
raises puts a stick in my wheel.

//

Anders



"Jim Douglas" <james.douglas (AT) genesis-software (DOT) com> wrote

Have our wrapper code check the results of the change by SELECT -1 or
SELECT
1 depending on success, then you should get something back from the
OLEDB
provider that you can use.



Reply With Quote
  #5  
Old   
Anders Arvidsson
 
Posts: n/a

Default Re: sp_password problems, ASE12.51 via ado-oledb from win app - 09-07-2004 , 04:26 AM



I have a feeling I'm overlooking something obvious,
hammer-in-the-forhead type thing. So I thought I'd supply my (now
very) stripped down SP for some hands-on advice.

create procedure sp_change_password(@old_password varchar(30),
@new_password varchar(31)) as
begin
set nocount on

declare @retval integer

execute @retval = master..sp_password @old_password, @new_password

if @@error <> 0
select -1
else if @retval <> 0
select -2
else
select 0
end
go

This is how it looks like.

If I run this one time to succeed and one to fail (new or same
@new_password) I get different results depending on where I run it.

ISQL gives me the outputstrings from sp_password AND the select
recordset - all good.

Trying from ADO Explorer, though, I just get a "The command(s)
completed successfully.", but no recordset. And if I supply the same
password I get:
"[Native Error code: 10316]
[DataDirect ADO Sybase Provider] New password supplied is the same as
the previous password. Please supply a different new password", and
no recordset.

This is pretty much how my app behaves as well. It executes without
problem, but as the execution goes well (I don't catch no _com_error)
- I just get an empty recordset back after it opens regardless of what
actually happens in the db. So, as I get an empty recordset, I can't
evaluate what actually happened in my app.

Am I missing something obvious in the SP?

My hunch is still that I'm not using ADO as I should to get the
recordset out from the oledb connection I have.

Thanks for any and all help!

Anders



"Jim Douglas" <james.douglas (AT) genesis-software (DOT) com> wrote

Quote:
Maybe the deal is that the SP is using "RETURN" vs "SELECT". I have seen
that before, change the SP to explicity use as the final good/bad select
"SELECT 1" or bad "SELECT -1"

Reply With Quote
  #6  
Old   
Anders Arvidsson
 
Posts: n/a

Default Re: sp_password problems, ASE12.51 via ado-oledb from win app - 09-14-2004 , 08:33 AM



As an update on my problem...

Working with sybase support has it narrowed down to either a problem
with the Sybase OLEDB provider or with how the Sybase OLEDB provider
interacts with ADO.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.