Error when trying to change password using SP_PASSWORD via ODBC

My application connects to SQL Server 2000 via ODBC (the DSN uses the SQL 
Server Authentication security) using PB7.03.  When I try to change 
password using sp_password, I got the following error:

SQLSTATE = S1093
[Microsoft][ODBC SQL Server Driver]Invalid parameter number. 

My PB scripts:

DECLARE change_password PROCEDURE FOR sp_password & 
         @old = :szold_password &
        ,@new = :sznew_password &
USING sqlca ;

sqlca.AutoCommit = TRUE

EXECUTE change_password ;

Any clues or suggestion?
0
Jack_W
1/30/2003 9:54:11 PM
sybase.powerbuilder.database 9855 articles. 2 followers. Follow

3 Replies
1051 Views

Similar Articles

[PageSpeed] 26
Get it on Google Play
Get it on Apple App Store

Jack;

Here is the code we use ......
_______________________________________________________________
CHOOSE CASE Upper(Left(sqlca.dbms,3))
  CASE "MSS","SYB","SYC"
     autocommit_orig = sqlca.autocommit
     sqlca.autocommit = TRUE
      if sle_old_password.text = "" or IsNull(sle_old_password.text) then
        sle_old_password.text = "null"
    end if
    sql = "sp_password "+sle_old_password.text+","+sle_new_password.text
    execute immediate :sql using sqlca;
    fn_db_error(sqlca,"Change Password")
    sqlca.autocommit = autocommit_orig
    if sqlca.sqlcode <> 0 and sqlca.sqlcode <> 100 then
       sle_new_password.SetFocus()
       return
    end if
  CASE "ODB"
   // This code applicable to Watcom only.
   sql = "GRANT CONNECT TO "+sqlca.userid+" IDENTIFIED BY
"+sle_new_password.text
   execute immediate :sql using sqlca;
   fn_db_error(sqlca,"Change Password")
   if sqlca.sqlcode <> 0 and sqlca.sqlcode <> 100 then
     sle_new_password.SetFocus()
     return
  end if
  CASE ELSE
   //unsupported database
   CloseWithReturn(parent,"")
    return
END CHOOSE

_______________________________________________________________
Hope that helps!

Regards .. Chris
Great White North Technical Evangelist


<Jack_W> wrote in message
news:6771DB2E3DBA1F290078510E85256CBE.0078516D85256CBE@webforums...
>
> My application connects to SQL Server 2000 via ODBC (the DSN uses the SQL
> Server Authentication security) using PB7.03.  When I try to change
> password using sp_password, I got the following error:
>
> SQLSTATE = S1093
> [Microsoft][ODBC SQL Server Driver]Invalid parameter number.
>
> My PB scripts:
>
> DECLARE change_password PROCEDURE FOR sp_password &
>          @old = :szold_password &
>         ,@new = :sznew_password &
> USING sqlca ;
>
> sqlca.AutoCommit = TRUE
>
> EXECUTE change_password ;
>
> Any clues or suggestion?


0
Chris
1/31/2003 12:51:25 PM
Chris, 
I tried your code and it works.  Thank you very much.  I wished I could but 
you a lunch for helping.

Here is the scope:

The PB scripts (see below) to call SP_PASSWORD does not work when the 
connection is via ODBC, it works though using the MSS (native) method. 

DECLARE change_password PROCEDURE FOR sp_password & 
@old = :szold_password &
,@new = :sznew_password &
USING sqlca ;

sqlca.AutoCommit = TRUE

EXECUTE change_password ;

For ODBC connection, I change how PB calls SP_PASSWORD (borrow from your 
code - see below) and it works.

sql = "sp_password " + sle_old_password.text + ","  + sle_new_password.text
execute immediate :sql using sqlca;
0
Jack_W
1/31/2003 3:49:02 PM
Jack;

  If you live in a warm place, I will be right over!

regards ... Chris

<Jack_W> wrote in message
news:ECCC7142C17301660056E32185256CBF.004D858A85256CBF@webforums...
>
> Chris,
> I tried your code and it works.  Thank you very much.  I wished I could
but
> you a lunch for helping.
>
> Here is the scope:
>
> The PB scripts (see below) to call SP_PASSWORD does not work when the
> connection is via ODBC, it works though using the MSS (native) method.
>
> DECLARE change_password PROCEDURE FOR sp_password &
> @old = :szold_password &
> ,@new = :sznew_password &
> USING sqlca ;
>
> sqlca.AutoCommit = TRUE
>
> EXECUTE change_password ;
>
> For ODBC connection, I change how PB calls SP_PASSWORD (borrow from your
> code - see below) and it works.
>
> sql = "sp_password " + sle_old_password.text + ","  +
sle_new_password.text
> execute immediate :sql using sqlca;


0
Chris
1/31/2003 3:55:04 PM
Reply:

Similar Artilces:

"Transaction not connected" error trying to connect to an ODBC database via PB7 Com in MTS
Non-database com object in MTS works aok, but connecting to a MSSQL Server database fails with "Transaction not connected" error. Seems like a rudimentary issue. Any tutorials or white papers re PB7/MSSqlServer 6.5/MTS? Any help apprecicated. -bac More details... DTS IS running on SQL Server. "Robert A. Chauvin" wrote: > Non-database com object in MTS works aok, but connecting to a MSSQL > Server database fails with "Transaction not connected" error. > > Seems like a rudimentary issue. > > Any tutorials or white pap...

Provider error in web.config (Tried to change Strong Password now getting error)
  All,Clubsite running on IIS 5, SQL Server 2000. I had the clubwebsite running perfectly, then decided to change the strong password section (Providers) as members had a hard time remembering their passwords.  I found a few places on the web including this site,where they stated you could change the provider section of the web.config.  When I did this, I forgot to save a copy of the working one, so now it doesn't work at all.  I get the following error:  Nohting else was changed except for the Provider section.  I tried to put it back the way...

Error when trying to change password
Hi, apparently my last post did not work. I don't know why, though. Bare with me if I double-postet for some reason ;o) OK here's my problem: I have two users that are trying to change their passwords and get this message: "Fehler beim �ndern des Passworts f�r Server <name of our tree> Fehlercode: oxfffffda7" In english sth. like: "An error occured when trying to change the password for server <name of our tree> Error code: 0xfffffda7" What it it trying to tell me? We don't use NMAS so we turned it off on the client, hoping it wou...

When I try to change a password I get error:
Password modification failed. The required dependencies were not found. Please reinstall this software from the original distribution to ensure the components are available. Refer to Novell documentation for the required prerequisites. > Password modification failed. The required dependencies were not found. > Please reinstall this software from the original distribution to ensure the > components are available. Refer to Novell documentation for the required > prerequisites. > Hi. We started getting the same error today, novell's online support and ...

error 0xfffffa4c when trying change password
We have 3 Netware servers with eDirectory 8.7.3 FP1 (EDIR8731.EXE) and one with eDirectory 8.7.3 IR6 (EDIR8736.EXE) and NICI 2.6.7. When users are logged in server with eDir 8.7.3.6 and trying change password, password did not changed with error 0xfffffa4c. I find only description these error - NICI E NOT FOUND. But if we recconnect user to any other server in tree, password was successfully changed witout any error. Help as please. -- With best regards, Peter S. Voronov Pvoronov, It appears that in the past few days you have not received a response to your posting. ...

error when trying to change user password
Hello everybody, when i try to change my novell user password fromout a windows XP workstation (sp2) NC 4.91sp4 (Novell 5.1) using the ctrl - alt - del and then change password - tool, i encounter an error 0xfffffda7 password not changed. This happens with all our workstations, not only mine. What can we do to let our users be able changing their passwords fromout their workstations again? THANK YOU FOR YOUR HELP -- csfaust ------------------------------------------------------------------------ csfaust, > (sp2) NC 4.91sp4 (Novell 5.1) using the ctrl - alt - del...

ODBC Error using Access Database
Hi, I am suddenly receiving an ODBC Error - "S1003 Program Type out of Range" When I try to open any tables in the database painter. I am sure thos was working recently. Has anybody got any ideas what could be going wrong? By the way, I can connect to the database and even add tables. I just can't retrieve data from them. Thanks in advance, Mark You must have updated your system, have you? Generally, when updating to MS Office 2000 or Win98SE causes this because the ODBC driver gets updated to ver 4.0. You shall have to update PB to 6.5.1 or higher. Brgds...

ODBC error (Database error)
Hi, We are working with PB 5.04 on Windows 95. When we use ODBC connectivity with Sybase SQL Anywhere databases we have problems with datetime (timestamp in SQLAnywhere) fields. The error that PB reports is : Database Error. SQLSTATE = 07006 [Sybase][ODBC Driver]: cannot convert 1990-07-14 00:00:00. -10742 to a date/time I have installed Windows95 (spanish version), Office97(spanish version), Internet Explorer 4.01 (spanish version), Microsoft Outlook 98 (spanish version), PB 4 and PB 5.04. I have another PC with Windows 95 (spanish version), Office97(spanish version), Inter...

Error in Changing Password using DirectoryEntry.Invoke
Hi  I am facing an error while changing/Setting the password. I am getting the below error  Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))” .     DirectoryEntry usr = new DirectoryEntry("LDAP://server.domain.com"); usr.Invoke("ChangePassword", new object[] { "oldpwd", "new" }); Its throwing error while calling the invoke method. Thanks and Regards, Shah    This works for me:            DirectoryEntry usr = new DirectoryEntry();&nb...

Error -601 if I try to change the user password
Hi, I get this error when I try to change the NDS password (NetWare 6.0 SP3). In the details of the Login policy, the "NDS change password" Method are grayed out under "avaiable Post Login Methods". I�ve deleted and recreated all Login Methods - nothing helps??? Thank You for help! Mit freundlichen Gruessen Martin Ehlers ******************************************************* ANDACOM net works GmbH Systemingenieur Stadtkoppel 45-49, 21337 L�neburg Tel. 04131-8936, Fax: 04131-893893 E-Mail: mehlers@andacom.de **************************************...

Change a Login password using sp_password SP
Hi all I want to change a login I have created using sp_addlogin, So I use sp_password But it always fail !! What could be the problem .... Notice: [I have sa_role, sso_role] Thanks in advance --------------------------------------- KPMG/Barents Group Waleed Seada Can you please tell what is your error message and what version of ASE. I just did the following and it works fine : sp_password "mypassword","new_password_for_userA","userA" HTH Harpreet "Waleed Seada" <ws_spartan@hotmail.com> wrote in message new...

Problems with Powerbuilder accesing an Acces Database via ODBC
I've developed an application with PB60, under windows NT Wk. 4.0 I compiled it and tested it under WNT Wrokstation 4.0 and it worked fun. Afetr it, I re-compiled and regenerated the application under W95, and when I tried to execute the .exe file compiled, I couldn�t acces the database, and I catched this error when trying to connect the SQLCA: "DBMS ODBC is not supported in your current Instalation". Moreover, if I run the application with the "RUN" painter, it works ok! I get the parameters to connect from an .INI file, which is in the same directory that t...

Users get fffffda7 error when trying to change password
Problem: Users passwords expire. They get prompted to change password. They comply and type in new password. When they click ok they get a "fffffda7" error message. They have to use grace login to log in. This error is a -601 no such entry in NDS error. The server they are connected to is a NW 5.1 box that holds the master replica of the partition that holds their user account. This is happening for multiple users at multiple sites. The users accounts are old and have 8 entries in their old password attribute. They are using client xp 4.91. I have tried to fi...

format error when trying to use --icon or changing the icon
Versions: - Windows Vista SP1 64-bit - Activestate Perl 32-bit 5.10.1003 - PAR 0.977 - PAR-Dist 0.29 - PAR-Packer 0.977 I'm trying to change the icon in the generated executable. I've tried 2 methods, each results in the same issue. Method 1: Using the "--icon" switch on the 'pp' command line. Method 2: Using "XN Resource Editor" to delete the camel icon and add my own icon The issue is that after I change the icon and run the executable, I receive the following errors (sometimes only a few, other times, many): format error: bad sign...

Web resources about - Error when trying to change password using SP_PASSWORD via ODBC - sybase.powerbuilder.database

SAP Sybase ASE 15.7 security updates
SAP Sybase Adaptive Server Enterprise is a relational database management product used to store financial, statistical, and virtually any other ...

Resources last updated: 1/12/2016 3:13:28 PM