Changing database password

Hello friends,
In my company there are a lot of users who access an oracle database to do their daily work. Often they need to change their password. Instead of using SQL Plus, is there any way for a user to change his database password using a browser or something. ?
thanks
san

You don't need any internal Oracle functions. As a privileged user, create a function like:
CREATE FUNCTION expire_soon (p_days IN NUMBER DEFAULT 5)
       RETURN BOOLEAN
       AUTHID CURRENT_USER AS
   l_res NUMBER;
BEGIN
   SELECT 1 INTO l_res
   FROM user_users
   WHERE expiry_date <= sysdate + p_days;
   RETURN TRUE;
EXCEPTION
   WHEN NO_DATA_FOUND THEN
      RETURN FALSE;
END;Then, grant execute on the function to PUBLIC. You could create a public synonym for the function, or simply use owner.expire_soon when you call it.
As part of your application login procedure call the function. If it returns TRUE, then prompt the user to change their password and either do:
ALTER USER user_name IDENTIFIED BY newpassword;or create another procedure to encapsulate the command.
HTh
John

Similar Messages

  • Database password change

    Hello,
    Can someone point me in the right direction in regards to changing the OIM database password on 9.1.0.2?
    We recently changed the password and I updated the xlconfig.xml file and updated two XML files located in the project domain using the method described in the below article:
    http://docs.oracle.com/cd/E13222_01/wls/docs81/admin_ref/utils17.html
    I copied the output generated and edited the <password-encrypted> node in the XML files.
    We are running WebLogic 10.3.3, on 10g database, 9.1.0.2 BP14 installed.
    OIM starts up though we get a System Error message but a refresh brings up the login page. After attempting to login the following error is recorded in our log files:
    ERROR,14 Feb 2012 08:49:45,138,[XELLERATE.WEBAPP],Class/Method: tcLogonAction/execute encounter some problems: Error occurred during login - Exeption Code: DB_READ_FAILED
    Thor.API.Exceptions.tcAPIException: Error occurred during login - Exeption Code: DB_READ_FAILED
    I presume it has to do with the password change but I have changed every file that I am aware of. Have I missed a step or missed a file? Is there a preferred way to change the database password within WebLogic? The UI doesn't allow it due to the encryption and I don't want to turn that off to clear text.
    Thanks,
    Andrew

    To change the database password, there are only a couple spots to update.
    Within WebLogic, you'll want to update your JDBC resources with the new password on your two connections listed.
    Then as you mentioned in the xlconfig.xml file, you'll find the sections for the DirectDB. Where the password is at, set the encrypted=false and provide the literal of your new password. Now when OIM starts, it will re-encrypt the xlconfig.xml file, so you can delete the one with plain text.
    -Kevin

  • Changing expired password on a cbckend database from a frontend database

    I have a split database with an Oracle backend (BE) and MS Access frontend (FE). My question is how to reset an expired password on the BE from the FE.
    If I log on to the backend via sqlplus an error ORA-28001 (Password expired) occurs and the system immediately prompts for a new password before completing the login process.
    If I log on from the frontend I get the same ORA error from the BE, but as far as I can tell, I can't reset the password from the FE.
    I can capture the error fine at the FE and I am thinking that I could use this to open a dialog to reset the password and change it over the ODBC connection. The problem is that I need to get a connection to the BE database before sending a command to change the password from the FE, but since login cannot be completed from the FE, because of the expired password, I can't get an ALTER USER statement to execute on the BE to reset the password.
    Is there a way to change a pre-expired password on an Oracle backend database from a frontend database? I don't see this as an Oracle/Access problem but as a problem that exists for any split database.

    I have thought about this a little and I am thinking about keeping a table of password update information. I can use this to create a "soft" expired password, using an expiration date in the table for each account. If the password is expired by the database then we can just update it with sqlplus or one of the other options.
    As far as getting the organization to change it is waaaay to big and stupid to change their policy.

  • Changing the password for OIM Database User

    We need to change the password of the database user that created and user to run the prepare_xl_db.sh. I changed the <password encrypted="true"> to "false" and modified the password in the xlconfig.xml and restarted the app server but I can't log in. I get the below error. - what else is needed?
    ERROR,30 Oct 2008 09:31:56,265,[XELLERATE.SERVER],Class/Method: XLJobStoreCTM/initialize encounter some problems: Error while connecting to Database. Please check if DirectDB settings are correct in Xellerate configuration file.
    FATAL,30 Oct 2008 09:31:56,265,[XELLERATE.SCHEDULER],QuartzSchedulerImpl constructor Exception
    org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'noTXDS': org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
    ) [See nested exception: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:429)
         at org.quartz.impl.jdbcjobstore.JobStoreCMT.initialize(JobStoreCMT.java:131)
         at com.thortech.xl.scheduler.core.quartz.XLJobStoreCTM.initialize(Unknown Source)
         at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:753)
         at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:885)
         at com.thortech.xl.scheduler.core.quartz.QuartzSchedulerImpl.initialize(Unknown Source)
         at com.thortech.xl.scheduler.core.quartz.QuartzSchedulerImpl.<init>(Unknown Source)
         at com.thortech.xl.scheduler.core.quartz.QuartzSchedulerImpl.getSchedulerInstance(Unknown Source)
         at com.thortech.xl.scheduler.core.SchedulerFactory.getScheduler(Unknown Source)
         at com.thortech.xl.scheduler.deployment.webapp.SchedulerInitServlet.startScheduler(Unknown Source)
         at com.thortech.xl.scheduler.deployment.webapp.SchedulerInitServlet.init(Unknown Source)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2371)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4824)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4748)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4936)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1145)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:741)
         at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)
         at com.evermind.server.Application.getHttpApplication(Application.java:570)
         at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1987)
         at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1906)
         at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:643)
         at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:290)
         at com.evermind.server.http.HttpServer.setSites(HttpServer.java:270)
         at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:177)
         at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2493)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1042)
         at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
         at java.lang.Thread.run(Thread.java:595)
    * Nested Exception (Underlying Cause) ---------------
    org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'noTXDS': org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
    ) [See nested exception: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
    )]

    During oim installation datasources are created to access the database.
    So when you change the password for the database user you have to adjust the password in the datasources.

  • I had to change my apple ID due to someone else using it and changing the password, so now i can't sign out of icloud as the email is wrong and i dont have the password to turn off find my iphone. Help!

    Basically, someone was hacking my apple account for a while and kept changing the password so i kept resetting it, now i've had to change my email as icloud still wouldn't accept my new passwords - even after being updated. Now i can't sign out of icloud due to it being the wrong email and an unknown previous password, as i can't turn off find my phone.ipad. How do i solve this without losing everything as i can't just delete the account and the usb ports on my laptop have gone so i can't back up to my laptop. I'm running completely on icloud but desperately need it to update so i don't lose all my uni work as well off my ipad.

    If you mean that Find My Phone is asking for a password to a different Apple ID to your current Apple ID and that ID is a previous version of your current ID, not an entirely different one.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details and some other circumstances.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID using your current password, you don’t need access to this address if it’s previously been used with your Apple ID, once you have saved these details enter the password as requested on your device and then turn off "find my phone" and delete the account from your device. It may take a short while to remove the account.
    You should then change your Apple ID back to its current state, save it once again and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.
    This is answer is provided from my own database of boilerplate responses and the content was last reviewed and tested on: 2014/05/23

  • User is not able to change his own password... Only DBA can change users password ??

    Hi,
    I have this problem today.I am using Oracle 8.1.7 on Solaris 2.8
    A Oracle user say " SCOTT" trying to change his password but could not.. he gets the followling message
    SQL> alter user scott identified by abc123;
    alter user scott identified by abc123
    ERROR at line 1:
    ORA-28003: password verification for the specified password failed
    Scott's profile has password_verfiy function. Hence i thought abc123 password was not matching with the password verify condition. Surprisingly, what ever password SCOTT tries with, he could get the same error message and could not change his password.. Ultimatly SCOTT could never change his password. How is it possible ??
    It is noteworthy to mention that if i give DBA role to SOCTT then he can change his password with abc123 or any thing that satisfies with password verification function.
    Now Only a user who has DBA role or a DBA could change passwords..
    Can somebody through some light on it and explain what corrective action to be taken so that Users can change their password without DBA's interreption.
    Thanks in advance
    Regards
    Srini

    <PRE>
    This is the description of the error message:
    =============================================================================
    ORA-28003 password verification for the specified password failed
    Cause: The new password did not meet the necessary complexity specifications
    and the PASSWORD_VERIFY_FUNCTION failed.
    Action: Enter a different password. Contact the database administrator to find
    out the rules for choosing the new password.
    =============================================================================
    it clearly says that password has to match the complexity specifications. You will not be able
    to change password without meeting the complexity requirements.
    DBA's can make the change to the password because if DBA's can not change the password, it could lock
    you out of the database (all users including the DBA's) and you will not be able to access the
    database.
    Try removing the password verify function and see if you can then change the password succssfully.
    </PRE>
    hi Prakash,
    The verify password function is standard oracle function and I do not think the current problem is any way related to the rules that were framed in verify password function. The key point here is a user could not change his own password. But a DBA or a user who has ALTER USER system privs.. can do so..
    Regards
    Srini

  • I have had 3 days worth of unauthorised purchases. How can I get my money back?  I have changed my password again and I have disabled my credit card.  My account is constantly getting hacked

    I am sick of getting hacked..... This is the 3rd time my account has been hacked.  This time it has only been for $30-40 but it is very alarming that it is getting hacked at all.  I have changed my password agian to a random thing.   Lets see how long I can stay hacked free this time.  If this continues I may have to put a formal complaint in to Apple.  And maybe only buy non-apple products....
    Ellen

    It's most likely not you, no matter what they say. I have noticed a LOT of fraud with itunes, even with my own account. One time I caught them doing a database restore. I know this because my password automagically reverted back to an old one! I'm an IT guy who helped design DOD classified networks in the mid-pacific. I know security. The best protection for this is to NOT have a credit card listed in iTunes. Use iTunes cards ONLY. It's a pain, but until they step up, it's all you got.

  • Need to change my password NOW, and where is a DBA when you really need one

    I'm attempting to teach myself SQL using the book "Murach's Oracle SQL and PL/SQL". They recommended downloading Oracle Express Edition. I downloaded Express Edition 11g. The book says it's applicable with all versions through 11g.
    Anyway, last Sunday I got a warning message, "ORA - 28002: The password will expire within 7 days.
    28002.00000 - "the password will expire within %s days"
    *Cause: The user's account is about to expire and the password needs to be changed
    *Action: change the password or contact the DBA
    Vendor code 28002
    I don't have a DBA; I'm trying to learn this stuff on my own. I've been corresponding with the book's author. He's been having me try different stuff
    (ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
    SELECT PROFILE FROM DBA_USERS WHERE USERNAME = SYSTEM;
    ALTER PROFILE <PROFILE_NAME> LIMIT PASSWORD_LIFE_TIME UNLIMITED; ) None of this worked. He finally wrote that I should access the Database Home Page to change the password for the existing users.
    Problem is, from the Oracle Database 10g Express Edition -> Go to Database Home Page, and that's not an option in my Oracle Database 11g Express Edition; my options are Get Help, Backup Database, Get Started, Restore Database, Run SQL Command Line, Start Database, and Stop Database.
    How can I change my password so my database doesn't lock up? The database is on my home computer, so if I can set it up so there is no password expiration time that would be preferrable.
    Thank you in advance for your help.

    Updating the profile after a password has expired is like closing the barn door after all the cows have left.
    Sure, the new cows won't be able to leave, new users created with the unlimited profile won't get the expired password problem but the 'escaped' cows still need to be fixed. Use a system or /as sysdba connection and set a new value for the user password.
    sqlplus /nolog
    conn /as sysdba
    ... connected ...
    alter user <username> identified by <new password> account unlock;
    conn <username>
    ... password ...
    ... connected ...
    alter user <username> identified by <a different password>;As soon as system (or sysdba) or any user with the DBA role fixes the user account <username> should be good to go. And can set his/her own password as well. Its your database, you get to be the DBA.
    Edited by: clcarter on Dec 3, 2012 12:57 PM
    fix code tag typos

  • How to change system password for 12c ?

    Hi,
    I encountered error "ORA-65040: operation not allowed from within a pluggable database" when changing password for system.
    sqlplus system/password@bpm
    SQL*Plus: Release 11.2.0.2.0 Production on Mon Apr 20 17:47:35 2015
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    ERROR:
    ORA-28001: the password has expired
    Changing password for system
    New password:
    Retype new password:
    ERROR:
    ORA-65040: operation not allowed from within a pluggable database
    Regards,
    eg

    I encountered error "ORA-65040: operation not allowed from within a pluggable database" when changing password for system.
    sqlplus system/password@bpm
    SQL*Plus: Release 11.2.0.2.0 Production on Mon Apr 20 17:47:35 2015
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    ERROR:
    ORA-28001: the password has expired
    Changing password for system
    New password:
    Retype new password:
    ERROR:
    ORA-65040: operation not allowed from within a pluggable database
    The SYSTEM user is a COMMON user.
    You need to be connected to the CDB/root to change it
    See the Oracle doc for how to connect to the root
    https://docs.oracle.com/database/121/NTDBI/startrdb.htm#CHDIIIDB
    8.5 Accessing Oracle Database with SQL*Plus
    To issue SQL and PL/SQL statements to Oracle Database, you can use SQL*Plus. This tool enables you to perform the same database management operations, and query, insert, update, or delete data directly in the database.
    To start SQL*Plus, from the Start menu, select All Programs, then Oracle - HOMENAME, then Application Development, and then SQL Plus.
    Alternatively, at the command line, you can enter the following command at a Windows command prompt:
    C:\> sqlplus /nolog  SQL> CONNECT user_name  Enter password: password 
    For example, to log on as SYSTEM using the password password, you enter:
    C:\> sqlplus /nolog  SQL> CONNECT SYSTEM  Enter password: password 
    Then change the password. You could also log onto the root as SYS as SYSDBA and then change the SYSTEM password.

  • How to create a  procedure to  change randomly passwords

    Hello,
    I am trying to create a procedure to change randomly passwords for all users in a database. I need this after the database cloning. I have too many users to alter in a manual way...
    Is there any option to create a procedure which will fetch all users in a database and alter them by a random password?
    I was not able to find any clue.
    Could you help me?
    Thanks

    Welcome to the forum.
    change randomly passwords for all users in a database.All users? Including SYS/SYSTEM? I hope not...
    But you could use DBMS_RANDOM.STRING and ALL_USERS and dynamic SQL.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_random.htm#sthref4675
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2114.htm#REFRN20302
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/dynamic.htm#LNPLS01101
    (easy to find when you do a quick search from http://www.oracle.com/pls/db102/homepage or http://www.oracle.com/pls/db112/homepage)
    DBMS_RANDOM.STRING can give you a random password easily:
    select dbms_random.string('x', 10)
    from   dual
    connect by level <= 10;Zo you could do something like:
    begin
      for rec in ( select t.username
                   ,      dbms_random.string('x', 10) new_pass
                   from   all_users t
                  -- where  t.username not in (...)
                  -- or
                  -- where  t.username in (...)
      loop
        --execute immediate ' alter user '||rec.username||' identified by '||rec.new_pass;
        dbms_output.put_line ('New password for user '||rec.username||' = '||rec.new_pass);
      end loop;
    end;
    /You'll have to fill in the where-clause yourself/
    I also commented out the dynamic alter user statement, since I'm not sure if you really want to reset the pwd's for all users.
    Also, instead of using dbms_output.put_line to check the new passwords, you could insert them in a table or spool the output to a file.

  • Changing the password of scom services account.

    hello experts,
    I have installed Single  SCOM Management Server with following services accounts , all the Domain Users account :
    Action Account
    Data Access Service
    Data Reader
    Data Ware Write Service
    also monitoring some of Computers.
    But now I have to change password of all these accounts  from AD,then I wants to know :-
    1. Where change the Password of  these Services Account on SCOM Management server.
    2.Are changing the passwords will effect the working of SCOM and monitoring of computer which are currently under monitoring of scom.

    1. Action account
       http://technet.microsoft.com/en-us/library/hh456432.aspx
    2. Data Access Service and Configuration Service account
      http://technet.microsoft.com/en-us/library/hh456438.aspx
    3. data Reader: reporting services configuration manager --> modify the following acouunts password , Report server service account , curent report server database credential, execution account
    roger

  • Changes to password are not reflected immediately in the application

    Hi All,
    If I change the password either from the console or through the application
    itself, the change are not reflected immediately. They are reflected when I
    shutdown both the admin server and managed server and bring them up. I think
    the previous password is cached somewhere. If so, how to refresh it. When I
    am changing the programatically ie using
    User.changeCredential(oldPassword,newPassword);
    I am refreshing the realm by using RealmMBean.refresh() . But it is not
    working. Right now i am using default file realm. Can anyone tell what i
    am missing here
    Thanks in advance
    Suresh

    Suresh,
    If your custom user extends DefaultUserImpl then you can update the password
    in that instance within the method User.changeCredential(...) as
    Construct the userinfo object with the old password
    Authenticate the user against the realm with the userinfo -- returns the
    customuser
    customuser.setCredential( ** new passsword**) (setCredential method of
    DefaultUserImpl)
    update the file/database
    Hope this works.
    -- Sunny
    "Suresh Done" <[email protected]> wrote in message
    news:3b4a4d7e$[email protected]..
    Hi All,
    If I change the password either from the console or through theapplication
    itself, the change are not reflected immediately. They are reflected whenI
    shutdown both the admin server and managed server and bring them up. Ithink
    the previous password is cached somewhere. If so, how to refresh it. WhenI
    am changing the programatically ie using
    User.changeCredential(oldPassword,newPassword);
    I am refreshing the realm by using RealmMBean.refresh() . But it is not
    working. Right now i am using default file realm. Can anyone tell what i
    am missing here
    Thanks in advance
    Suresh

  • Changing DMSYS password in EBS 11i

    Hi ,
    Followed 189367.1. page 51-56 in the pdf file and didnt found how change this schema .
    Can i just run alter user dmsys identified by xxxx , or should i change the FNDCPASS utility ?
    Thanks

    Pl post details of OS, database and EBS versions.
    Password for DMSYS schema can be changed using the ALTER USER command. FNDCPASS cannot be used to change the password for this schema as it is not an EBS schema.
    HTH
    Srini

  • How to Change Database of Report before Exporting?

    I am having difficulties changing the database that the report should run against.
    We are using Oracle.  In the past when scheduling a report through CE, I would manipuate the Desktop.ReportLogons object.  For Oracle I simple changed the CustomServerName, CustomUserName, and CustomPassword properties.  Everything worked fine when the report was scheduled and ran.
    Now I am doing an on-demand report without an interactive viewer.  I am doing everything in code using RasAppFactory and the ReportClientDocument.
    I am looking at the DatabaseController of ReportClientDocument.  I thought I could just use the LogonEx method passing in the server, user, password, and an empty string for the database since for Oracle connections you only specify server and not database.  However, it is still trying to connect to the defined database.
    Can someone point me to an Oracle specific example of how to properly change database info when report runs?
    Do I need to be using other methods like one of the SetTableLocation methods?
    Thanks in advance for any help.

    Hello, Stephen;
    You are correct, with Oracle you do not need the Database property.
    The person logged on to Business Objects Enterprise through the RAS .NET application would need rights to make the change in database connections. Can the usr with the same logon make the change directly in Enterprise?
    The ReportClientDocument separates the Server Name and Database from the User ID and Password with the PropertyBag. The convenience methods such as LogonEx will only change the User ID and Password. To change all four properties you need the full RAS logon code.
    The full logon for RAS would use code as shown below.
    Elaine
    ==========================================
    Imports System
    Imports Microsoft.Win32
    Imports CrystalDecisions.Enterprise
    Imports CrystalDecisions.Enterprise.Desktop
    Imports CrystalDecisions.CrystalReports.TemplateEngine
    Imports CrystalDecisions.ReportAppServer.ClientDoc
    Imports CrystalDecisions.ReportAppServer.Controllers
    Imports CrystalDecisions.ReportAppServer.ReportDefModel
    Imports CrystalDecisions.ReportAppServer.DataDefModel
    Imports CrystalDecisions.ReportAppServer.CommonObjectModel
    Imports CrystalDecisions.ReportAppServer.ObjectFactory
    Partial Class Logon
        Inherits System.Web.UI.Page
        Dim mySampleReportName As String = "SimpleSetLogonInfo.rpt"
        Dim crServerName As String = "myOracle"
        Dim crDatabaseName As String = ""
        Dim databaseUserName As String = "tester"
        Dim databasePassword As String = "tester"
        Dim crDatabaseController As DatabaseController
        Dim crDatabase As Database
        Dim crTableOld, crTableNew As Table
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            ConfigureCrystalReports()
        End Sub
        Private Sub ConfigureCrystalReports()
            DatabaseLogon_managedRAS()
        End Sub
        Private Sub DatabaseLogon_managedRAS()
            Dim mySessionMgr As New SessionMgr()
            Dim myEnterpriseSession As EnterpriseSession
            Dim myReportAppFactory As ReportAppFactory
            Dim myInfoStore As InfoStore
            Dim myInfoObjects As InfoObjects
            Dim myInfoObject As InfoObject
            Dim myReportClientDocument As ReportClientDocument
            Dim myEnterpriseService As EnterpriseService
            Dim myObject As Object
            myEnterpriseSession = mySessionMgr.Logon("administrator", "", "CMS_Server", "secEnterprise")
            myEnterpriseService = myEnterpriseSession.GetService("InfoStore")
            myInfoStore = New InfoStore(myEnterpriseService)
            myInfoObjects = myInfoStore.Query("Select SI_ID From CI_INFOOBJECTS Where SI_NAME='" + mySampleReportName + "' And SI_INSTANCE=0")
            myInfoObject = myInfoObjects(1)
            myObject = myEnterpriseSession.GetService("", "RASReportFactory").Interface
            myReportAppFactory = CType(myObject, ReportAppFactory)
            myReportClientDocument = myReportAppFactory.OpenDocument(myInfoObject.ID, 0)
            'Convenience methods not to change Database or Server name from what is in the report
            'myReportClientDocument.DatabaseController.logon("UID", "PWD")
            'myReportClientDocument.DatabaseController.LogonEx("myServerName", "myDatabase", "UID", "PWD")
            crDatabase = myReportClientDocument.DatabaseController.Database()
            crDatabaseController = myReportClientDocument.DatabaseController()
            ' Loop through all the tables in the main
            ' report and set their new table information.
            For Each crTableOld In crDatabase.Tables
                crTableNew = GetNewTable(crTableOld, crServerName, crDatabaseName, databaseUserName, databasePassword)
                crDatabaseController.SetTableLocation(crTableOld, crTableNew)
                crTableNew = Nothing
            Next
            crDatabase = Nothing
            crTableOld = Nothing
            myCrystalReportViewer.ReportSource = myReportClientDocument
        End Sub
        Private Function GetNewTable(ByVal crTableOld As Table, ByRef serverName As String, ByRef databaseName As String, ByRef userName As String, ByRef password As String) As Table
            ' Create crTableNew as a new table, then fill its properties.
            Dim crTableNew As New Table
            Dim crAttributes, crLogonInfo As PropertyBag
            ' Set some of the properties of the new table object.
            crTableNew.ConnectionInfo.UserName = userName
            crTableNew.ConnectionInfo.Password = password
            crTableNew.ConnectionInfo.Kind = crTableOld.ConnectionInfo.Kind()
            crTableNew.Name = crTableOld.Name
            crTableNew.Alias = crTableOld.Alias
            ' Make a copy of the connectionInfo.Attributes and apply them to the new table.
            crTableNew.ConnectionInfo.Attributes = crTableOld.ConnectionInfo.Attributes.Clone(True)
            crAttributes = crTableNew.ConnectionInfo.Attributes()
            ' Check to ensure the connection info Kind is correct then change the a
            ' appropriate properties in the PropertyBag.
            ' These will vary from report to report using ODBC, OLEDB or Native drivers
            ' To find out your properties
            ' open your report in the Crystal Reports Designer and go to Database,
            ' Set Location menu. Check the properties of your connection and note
            ' the name of the properties that will change.
    'ODBC to Oracle "Data Source Name" and "Table Name" with "Owner"
    'OLEDB to Oracle "Provider" "Data Source" and "Table Name" with "Owner"
            If crTableNew.ConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE Then
                crLogonInfo = CType(crAttributes("QE_LogonProperties"), PropertyBag)
                crLogonInfo("Data Source") = crServerName
                'MS SQL Server OLEDB
                'Leave out for Oracle
                'crLogonInfo("Initial Catalog") = crDatabaseName
            End If
            ' Adjust the qualified name, then return the new table object if the table name has changed
            crTableNew.QualifiedName = "Owner." & crTableNew.Name
            Return crTableNew
        End Function
    End Class

  • Change Default Passwords of....

    Can I change the passwords of the users:
    TRACESVR
    AURORA$ORB$UNAUTHENTICATED
    DBSNMP
    NAMES
    OUTLN

    I've changed the passwords of OUTLN and DBSNMP before. I don't have the other users on my databases but I would think you can
    change those too. Try changing them in a test database and see what happens. That's what test databases are for.

Maybe you are looking for

  • I had to reinstall my OS and now iPhoto doesn't work.

    Can I reinstall without having to re-purchase? My computer was going slow so Apple support suggested that I do a TimeMachine backup, clear the computer and reinstall the OS. I have been having problems ever since and my computer STILL runs slow. Righ

  • Automatic acceptance of appointments in Outlook when using GW Integration

    Hi, we use Groupware Connector 2.0 with CRM 4.0. Here it is the case thatif you create an appointment in CRM this appointment is sent to Groupware to the calendars of the participants. If ou create an appointment manually in Outlook, all invited peop

  • Playback of unticked songs

    Because of limited space on my iPod, I have unticked items in my iTunes library, so they don't sync. But I still want to listen to entire albums in sequence on my PC, even though only a couple of those tracks have been ticked to transfer to the iPod.

  • Byte Order for Floating Point Types

    I need to send an array of floating point values from an x86 C++ application to a Java application. I am using a socket to transfer the data. What, if anything, do I have to do about preserving the correct byte order?

  • Help with expanding partition

    I have Mac OS X alongside Windows 7. I'm getting a huge game for windows and i don't have enough space on the windows partition. I Made a bootable Ubuntu cd and i'm going to use GParted to resize the partition. Now what i want to now is there a risk