Grant permission through dynamic parameters entered by user through web app

This is my code.
f1=request.getParameter("URL");
out.println("parameter f1 ===>"+f1);//user name
f2=request.getParameter("URL1");
out.println("parameter f2 ===>"+f2);//table name
f3=request.getParameter("URL2");
out.println("parameter f3 ===>"+f3);//privilege name
sql="GRANT f3 to \"" + f1 + "\""+"on \""+f2+"\"";
st= con.createStatement();
st.execute(sql);
out.println("grant succeeded");
it is giving error that invalid SQL query.please help in writing this code.Any other method for giving dynamic SQL query for granting permission.

Welcome to the forum!
>
Any other method for giving dynamic SQL query for granting permission.
>
You should NOT be using dynamic SQL for issuing grants. Security is something that should be taken seriously and grants should ONLY be given to users that need the permission. The necessary grants should be created and reviewed BEFORE they are executed.
Best practices are to create scripts containing your DDL and place those scripts in a version control system.
The scripts can then be executed in sql*plus, sql developer or another tool and the results reviewed to ensure that they executed properly.
If dynamic SQL is needed you:
1. create a sql statement manually and test it to make sure it works properly
2. create the code to assemble similar statements and VIEW the output DDL to make sure that it is valid
3. add exception handling and security handling to the code so that is can only be used for the intended operations and is not subject to SQL injection.
4. manually execute the DDL produced by the code to make sure there are no syntax errors.
Clearly you did not even test your SQL before trying to write code to produce it or you would have known your syntax is invalid.
>
sql="GRANT f3 to \"" + f1 + "\""+"on \""f2"\"";
>
>
it is giving error that invalid SQL query.
>
Of course it is. That code might try to produce the equivalent of:
GRANT select to "scott" on "hr.employees";There are SEVERAL errors in that code.
1. You are enclosing the SCHEMA in double-quotes. That means the actual user name will be treated as case-sensitive. So if someone provides 'scott' it will be considered lower-case. There is NO user "scott" in Oracle unless you created that user yourself and used double-qoutes to preserve the case.
ALL of the schemas created by Oracle, and most users, are UPPER case. So your code will not find any name if the user supplies a LOWER case or mixed-case value.
2. You are enclosing the target schema and object name in double quotes. There are two things wrong. The same case issue applies again. And the string "hr.employees" will be treated as ONE value. The proper way to quote such a value is:
"HR"."EMPLOYEES"3. You have the DDL components in the wrong order, hence it is invalid. The ON clause comes BEFORE the target schema.
GRANT select to on hr.employees to scott;See the SQL Language doc for the GRANT statement
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9013.htm
All of the issues you have demonstrate why you should NOT be using dynamic SQL to do DDL. You don't understand the syntax so you can't write code to implement that syntax.
The syntax is much more complex than the siimple code you are trying to use.
Grant statements often need to include "SCHEMA.OBJECT" syntax and your code makes no provision for that.
DDL needs to be tightly controlled and doing it in code can create huge, gaping security holes.
Abandon your method and use prepared scripts for the DDL commands you need to execute.

Similar Messages

  • PHP_MySQL version of a high security user authentication web app.

    Since you folks deal with PHP Application Development, I am posting this here.
    For a demo of the PHP_MySQL version of the UltraSuite High Security User Authentication Web Application, you can sign up at http://bit.ly/hgNjek.
    It  offers a multi-layered approach security approach towards protecting  important information like user authentication credentials.  Protection from dictionary attacks, rainbow table attacks, brute force attacks, SQL injection attacks and much more.
    I hope your feedback will help make the application even more useful and secure.
    Thank you!
    J.S.

    Hi,
    could you or someone tell me if ADDT supports protection against these methods you mention:
    Protection from dictionary attacks, rainbow table attacks, brute force attacks, SQL injection attacks and much more??
    And can this system work alongside ADDT?
    thanks again

  • BEX query runs using parameters entered by user in an Excel spreadsheet

    I'm trying to write a macro to automate certain functions for our users.</br>
    </br>
    Essentially, the users would enter numbers (relating to clients) in column A and e-mail adresses in column B.  A set of reports would run based on the first number entered, then the workbook would be saved and e-mailed to the first address in column B.  This would be repeated for the 2nd number/address and so on...  All Bex reports are in the same workbook.  At this point, I'm having a lot of problems finding code that will fill in the Bex query parameters automatically based on inputs in the spreadsheet.  Here is what I've worked up so far for the macro:</br>
    </br>
    Option Explicit</br>
    </br>
    'Macro step 1 u2013 run workbook for client number input and continue</br>
    'EXAMPLE u2013 cell A3 = 1008, cell A4 = 1240</br>
    'All BW queries should run based on the input given in column A (beginning wth A3).</br>
    </br>
    </br>
    'Macro step 2 u2013 create directory for the new files and save the first file</br>
    '     This step will allow the user to save the new files in a new folder in an existing directory, or even to create a new directory:</br>
    </br>
    Function GetFolderPath() As String</br>
        Dim oShell As Object</br>
        Set oShell = CreateObject("Shell.Application"). _</br>
        BrowseForFolder(0, "Please select folder", 0, "c:
    ")</br>
        If Not oShell Is Nothing Then</br>
            GetFolderPath = oShell.Items.Item.Path</br>
        Else</br>
            GetFolderPath = vbNullString</br>
        End If</br>
        Set oShell = Nothing</br>
    End Function</br>
    </br>
    Sub Testxl()</br>
        Dim FName As String</br>
        Dim WbName As String</br>
        Dim Search As String</br>
        Dim Prompt As String</br>
        Dim Title As String</br>
        Dim MyDir1 As String</br>
        Dim MyDir2 As String</br>
        Dim Passed As Long</br>
         </br>
    On Error GoTo Err:</br>
         </br>
        FName = GetFolderPath</br>
        If FName <> vbNullString Then</br>
            Prompt = "Please Select a FileName"</br>
            Title = "Name"</br>
            Search = InputBox(Prompt, Title)</br>
            If Search = "" Then Exit Sub</br>
        End If</br>
        FName = FName & "\" & Search</br>
        MkDir FName</br>
        ActiveWorkbook.SaveAs FName & "\" & Search & ".xls"</br>
         </br>
         'Test for existence of new folders.files</br>
        Passed = 1</br>
        GetAttr (FName)</br>
        Passed = 2</br>
        GetAttr (FName & "\" & Search & ".xls")</br>
        Passed = 3</br>
        GetAttr (ActiveWorkbook.Path & MyDir1)</br>
        Passed = 4</br>
        GetAttr (ActiveWorkbook.Path & MyDir2)</br>
    </br>
        End</br>
         'Sheets("Sheet1").Range("B1").Value = Search **Add if you require the name to be recorded in your spreadsheet</br>
    Err:</br>
        Select Case Err</br>
        Case 53:           MsgBox "File/Folder not created. Failed at step " & Passed</br>
        Case 75:    MsgBox "Folder already exists"</br>
        End Select</br>
    End Sub</br>
    </br>
    'Macro step 3 u2013 save workbook</br>
    ActiveWorkbook.Save</br>
    </br>
    'Macro step 4 u2013 e-mail workbook</br>
    'EXAMPLE u2013 cell B3 = amay@email, cell B4 = bmay@email</br>
    'The workbook should e-mail based on the input given in column B (beginning wth B3).</br>
    wb.SendMail  u201Ccell B3u201D</br>
    </br>
    'Macro step 5 u2013repeat until no inputs remain</br>
    'EXAMPLE u2013 cell A3 = 1008, cell A4 = 1240</br>
    'Steps 1-4 should repeat for cell A4, then A5 (if necessary) and so on until no more inputs remain.  </br>
    </br>
    </br>
    If anyone has any advice I'd love to try it out.</br>
    </br>
    Thank you for your time.</br>
    Andy
    Edited by: AndyMay on Jul 14, 2009 5:08 PM - I inserted html breaks

    Option Explicit</br>
    </br>
    Sub KeyClient()</br>
    </br>
    'Macro step 1 - filter workbook for client number input and continue</br>
    'EXAMPLE - cell B3 = 1008, cell B4 = 2048</br>
    'All BW queries should run based on the input given in column B (beginning wth B3).</br>
    </br>
    'define x and begin loop</br>
    Dim i, x As Integer</br>
    Dim curCell As Range</br>
        For x = 3 To 22</br>
        Set curCell = Worksheets("Input").Cells(x, 2)</br>
    </br>
    'stop BW from refreshing until we are finished</br>
        Run "SAPBEX.XLA!SAPBEXPauseOn"</br>
        Run "SAPBEx.XLA!SAPBEXsetFilterValue", curCell, "", Sheets("Client Contribution").Range("C9")</br>
    'BW resumes refreshing</br>
        Run "SAPBEX.XLA!SAPBEXPauseOff"</br>

  • Using date parameters entered by user within Chart

    I would like to allow the end user to populate a start date and end date which will be used to generate a Pie Chart. I have been following posting How to Create a Chart from a user's date range input ? and I'm having problems.
    I have created two Page Items to allow the user to enter a date range. Both Page Items are set to Date Picker ('DD-MON-RR') The start date has a default value set to the first day of the year by using round(SYSDATE, 'YYYY') The end date defaults to SYSDATE.
    The flash chart series is defined as the following:
    select null link, trunc((months_between(sysdate, c.DATE_OF_BIRTH))/12) label, count(*) value1
    from FAMILY_INTAKE f
    , CLIENT c
    where f.client_id = c.client_id
    AND f.intake_date between nvl(:P19_START_DATE, f.intake_date) AND nvl(:P19_END_DATE, f.intake_date)
    group by trunc((months_between(sysdate, c.DATE_OF_BIRTH))/12)
    When I run the page, the pie chart works; however, it does not seem to use the values used in the date parameters. It seems to be using the null value of f.intake_date. No matter what I set the date parameters to, the results are always the same.
    Any help would be appreciated... Thanks!
    Pam

    How does one operate the page? Select one or two date values and press Go, or something? Then the page branches back to itself? If so, are the date items showing the selected values or getting reset?
    Scott

  • JSTL not working on EJB user view web app

    hi people,
    i found an error while trying to have a EJB 3.0 jpa persistent conection and jstl library. this is the error i got:
    [04:57:34 PM] Wrote Web Application Module to /home/isanchez/.jdeveloper/system11.1.1.3.37.56.60/o.j2ee/drs/GeCU/ViewWebApp.war
    [04:57:34 PM] Wrote EJB Module to /home/isanchez/.jdeveloper/system11.1.1.3.37.56.60/o.j2ee/drs/GeCU/ViewEJB.jar
    [04:57:34 PM] WARNING: Connection Developer has no password. Developer-jdbc.xml file not generated for connection Developer.
    [04:57:34 PM] removed bundleresolver.jar from lib because it cannot be part of an EJB deployment
    [04:57:34 PM] Wrote Enterprise Application Module to /home/isanchez/.jdeveloper/system11.1.1.3.37.56.60/o.j2ee/drs/GeCU
    [04:57:34 PM] Deploying Application...
    <01-jun-2010 16H57' CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1275404254910' for task '11'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'SessionEJB' declared in the ejb-ref or ejb-local-ref 'ejb/local/SessionEJB' in the application module 'ViewWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
         at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:453)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    <01-jun-2010 16H57' CEST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'GeCU'.>
    <01-jun-2010 16H57' CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'GeCU'.>
    <01-jun-2010 16H57' CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'SessionEJB' declared in the ejb-ref or ejb-local-ref 'ejb/local/SessionEJB' in the application module 'ViewWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
         at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:453)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    [04:57:36 PM] #### Deployment incomplete. ####
    [04:57:36 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    #### Cannot run application GeCU due to error deploying to IntegratedWebLogicServer.
    [Application GeCU stopped and undeployed from Server Instance IntegratedWebLogicServer]
    there is a bean that uses the Result class from jstl, all libraries are well defined and the projecto compiles fine.
    import javax.servlet.jsp.jstl.sql.Result;
    can someone help me out with the root of this problem? thank you in advance!!!
    Israel S Llorens

    Hi,
    According to your description, my understanding is that the Remote Event Receiver sometimes not fire when you create a new sub site.
    I suggest you can try to debug the remote event receiver using Azure Service Bus to find if there is something wrong cause the remote event receiver not fire.
    Here is a detailed article for your reference:
    http://blogs.msdn.com/b/officeapps/archive/2013/01/03/debugging-remote-event-receivers-with-visual-studio.aspx
    Thanks
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jerry Guo
    TechNet Community Support

  • Grant permission to all objects of a schema to apps user(Oracle 10g)

    Dear Fiiends,
    I would like to grant permission on all objects of a particular schema to apps user(Oracle 10g).How do I do it?
    (ex)grant all on <schemaname>.<objectname> to apps with grant option.
    This is the permission i want to give but i can't do it for all objects one by one so how do i do it in a single command.
    Regards,
    Arun

    You can't do it in a single command. You have to give object-by-object privileges (you could grant something like SELECT ANY TABLE, but that applies to every schema in the database and is generally a rather bad idea). You can, however, use a bit of dynamic SQL to do the job, i.e.
    FOR x IN (SELECT * FROM user_tables)
    LOOP
      EXECUTE IMMEDIATE 'GRANT ALL ON schema_name.' || x.table_name || ' TO apps WITH GRANT OPTION';
    END LOOP;You can do the same with other object types, hit DBA_TABLES rather than USER_TABLES if you don't want to run this as the object owner, etc.
    Justin

  • Multiple users, using the same web app items?

    Iam building a service for familes were the parents should be able to read / add / edit the same secure web app items.
    So when logged in the user have access to the same user submitted web app items.
    I found a thread answerd by Liam and my guess this is not possible? Can it be partial be done e.g. just let the "family" read the familys items? And no there is not possible to add / pair the users in backend because there are to many.
    Any tip where to look? I have tried to use the "uniqe ID, datasource, unique template" method but do you "wizards" :-) think that's the way to go?
    This thread suggest it's not doable.
    http://forums.adobe.com/message/5547102
    Thanks!
    //Johan
    Formpartner

    Not in association Johan no.
    You can have one "Family" login they all use to log in but it will kick one out if the other logs in and of course, multiple people sharing the same login increases the security risk.
    You can only set one owner as well.

  • How to set user parameters in transaction MD61 through a report?

    Hi,
    I want to set default values for 'Requirement Type' in user parameters of transaction MD61 through a report. Please help.
    Thanks in Advance.

    Create Variant using SHD0 and with Group and assign to particular user's
    Here is the steps
    Creating a Variant Group
    1. Open transaction SHD0, enter the transaction code, and press enter.
    2. Choose the Standard Variants tab page, and then the sub tab page Variant Groups, and enter a group name, such as GROUP_GEN
    3. Choose Create. Enter a short text on the Maintain Variant Group window that appears and save the variant group.
    Assigning Users
    Once you have created the variant group and the relevant transaction variants with screen variants, you now need to assign users to the variant group as follows
    1. Return to the Standard Variants tab page, Variant Groups sub tab page.
    2. Enter the name of a user that you want to assign to this variant group, and choose Assign. A message that this user was successfully assigned to the variant group appears in the status bar. If you choose a where-used list for users, this user is displayed in the user list.
    3. However, for the screen variants of the variant group that you created above to be displayed for the user, you first need to select Set Proposal. The user is assigned to the group and the associated transactions are started with the corresponding variants only once you choose the Set Proposal function.
    You can use this procedure of user assignment for all other users that you want to add to the variant group
    Hope this helps.
    Thanks
    S.N

  • How to grant permission to user to access Lync 2013 OcsPowerShell

    I'm writing script for our first line for creating Lync users. I need give access to connect to https://lyncpool.domain.local/OcsPowerShell via powershell. Only users in CSAdministrator group have permission to connect, but this group have to much
    privileges. I created custom group with custom permissions and I need grant permission to this group to access OcsPowerShell.

    Try giving them CsUserAdministrator RBAC membership. They should be able to run the following cmdlets to manage the users only:
    Disable-CsUser
    Enable-CsUser
    Get-CsAdUser
    Get-CsUser
    Get-CsUserClusterInfo
    Move-CsUser
    Move-CsLegacyUser
    Set-CsUser
    Grant-CsClientPolicy
    Grant-CsClientVersionPolicy
    Grant-CsConferencingPolicy
    Grant-CsDialPlan
    Grant-CsExternalAccessPolicy
    Grant-CsHostedVoicemailPolicy
    Grant-CsLocationPolicy
    Grant-CsPinPolicy
    Grant-CsVoicePolicy
    Get-CsArchivingPolicy
    Get-CsClientPolicy
    Get-CsClientVersionPolicy
    Get-CsConferencingPolicy
    Get-CsExternalAccessPolicy
    Get-CsHostedVoicemailPolicy
    Get-CsLocationPolicy
    Get-CsPinPolicy
    Get-CsVoicePolicy
    Get-CsClientPinInfo
    Unlock-CsClientPin
    Lock-CsClientPin
    Set-CsClientPin
    Get-CsClientVersionConfiguration
    Get-CsDialPlan
    Get-CsSite
    Get-CsComputer
    Get-CsNetworkInterface
    Get-CsPool
    Get-CsService
    Get-CsSipDomain
    Revoke-CsClientCertificate
    If this helped you please click "Vote As Helpful" if it answered your question please click "Mark As Answer" | Blog
    www.lynced.com.au | Twitter
    @imlynced

  • HT1338 I have macbook without a firewire port, I have usb 2.0 port, now my os is not working I can not get through apple logo loading , I can not enter safe mode, I can only enter one user mode, how can I backup my data, I have very important data in my h

    I have macbook without a firewire port, I have usb 2.0 port, now my os is not working I can not get through apple logo loading , I can not enter safe mode, I can only enter one user mode, how can I backup my data, I have very important data in my hdd

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • Crystal Reports Dynamic Parameters with SAP Business One

    Okay, I've got this very strange issue with dynamic parameters in Crystal Reports connected to SAP Business One.
    Let's start with the software versions:
    - Crystal Reports 12.3.0.601
    - SAP Business One 8.8 (8.80.231) SP: 00 PL: 13
    - Windows XP SP3
    (SBO Server on Windows 2003 and SQL 2005)
    What I'm about to describe is something I've tried in several reports and for which I created a very, very simple test report to see if it was reproducible in a very simple situation.
    - I connected to a Business One server through CR's SBO connection type. Logon is successful, tables are shown.
    - I pick OCRD and plac CardCode and CardName in the details section on the report. Previewing the report shows data.
    - I create a dynamic parameter on CardCode and in the Select Expert I select the CardCode field and define that that should be equal to the parameter.
    - I preview the report again. Now it asks me in such a parameter screen for logon credentials. It shows the server and database it tries to connect to and in the username it shows the SQL Server username I used to connect to the SQL Server in the first place. However, the password for that user is not accepted. I also tried to login with the Windows administrator user and with the SBO manager user, but no success with any attempt.
    I also tried to add a static parameter and add all database values to the list. Same screen, different result:
    Crystal Reports 2008 wrote:
    Logon Failed.
    Error in File UNKNOWN.RPT:
    Unable to connect: incorrect log on parameters. (rptcontrollers.dll)
    (On a side note: the report is saved as report1.rpt)
    Anyone else got similar issues and found a solution?

    Hi,
    When you have fixed your crystal installation following the note posted earlier, please take a look at the [how to guide|http://service.sap.com/sapidb/011000358700000882232009E.pdf] and also at the [e-learning|http://service.sap.com/sapidb/011000358700001370262010E] about SAP Business One 8.8 and Crystal Reports.
    There are so called "tokens" which you need to use instead of dynamic parameters.
    Dynamic paramters don't work in SAP Business One 8.8, if they are not defined as a static paramter with token.
    Best regards,
    Darius

  • Crystal Report Viewer Credential Prompt for Report with Dynamic Parameters

    The .NET Crystal Report Viewer is prompting for database credentials when launching a report containing dynamic parameters. This only occurs for reports created with SAP Crystal Reports 2011 designer. Reports created with Crystal Reports XI designer (where dynamic parameters were first introduced) work correctly.
    The credential prompt window contains the following fields:
    - Server Name: <server name> (disabled)
    - Database Name: <database name> (disabled)
    - User Name: <empty> (enabled)
    - Password: <empty> (enabled)
    - Use Single Signon Key: false (disabled)
    The values in the prompt window which are disabled are the database connection values used during the design of the report in the SAP Crystal Reports 2011 designer.
    Expected Result:
    - No prompt for database credentials.
    - Values read from the database should be populated in a drop down for the dynamic parameters.
    Environment:
    - Visual Studio 2010 (C#)
    - Windows 7 Enterprise
    - SAP Crystal Reports runtime engine for .NET Framework 4
    - SAP Crystal Reports, version for Visual Studio 2010
    - SAP Crystal Reports 2011
    The database connection is being set to use a DSN. It must be a DSN as the calling application is only aware of the DSN/Username/Password values. These values are being passed to the Crystal Report Viewer contained in a Windows form.
    The database connection for the report is being set as follows:
    foreach (InternalConnectionInfo internalConnectionInfo in this.report.DataSourceConnections)
        // Must set the UseDSNProperties flag to True before setting the database connection otherwise the connection does not work
        if (internalConnectionInfo.LogonProperties.ContainsKey("UseDSNProperties"))
            internalConnectionInfo.LogonProperties.Set("UseDSNProperties", true);
        // Supposed to set the database connection for all objects in the report (ie. main report, tables, sub reports)
        internalConnectionInfo.SetConnection(this.DSN, string.Empty, this.LoginName, this.Password);
    The SetConnection method's signature is as follows:
       SetConnection(string server, string database, string name, string password)
    As you can see from the code snippet above I am setting the DSN name as the server parameter, blank for the database parameter (a database connection using DSN should only require DSN name/Username/Password) and the database username and password respectively.
    Is this a SAP bug?
    Is this the correct way of setting the database connection to use a DSN?
    Is there some other properties that need to be set somewhere else in the report through code?
    Any help would be greatly appreciated.

    Thanks for the pointer to the database connection code generator. After taking a look at the output from the tool I was able to finally get the dynamic parameters to load and populate properly without prompting for credentials. I needed to tweak the outputted code a bit to match my requirements of using a DSN only connection.
    Instead of updating the database connection properties contained within the Report.Database.Tables collection from the CrystalReports.Engine namespace, I changed it to replace the database connection properties in the Report.ReportClientDocument.DatabaseController.Database.Tables collection from the CrystalDecisions.ReportAppServer.DataDefModel namespace. For one reason or another, using the RAS namespace solved the problem.
    Below is the updated code with the change made:
    using RAPTable = CrystalDecisions.ReportAppServer.DataDefModel.Table;
    foreach (InternalConnectionInfo internalConnectionInfo in this.report.DataSourceConnections)
        // Must set the UseDSNProperties flag to True before setting the database connection
        if (internalConnectionInfo.LogonProperties.ContainsKey("UseDSNProperties"))
            internalConnectionInfo.LogonProperties.Set("UseDSNProperties", true);
        // Sets the database connection for all objects in the report (ie. main report, tables, sub reports)
        internalConnectionInfo.SetConnection(this.DSN, string.Empty, this.LoginName, this.Password);
    // The attributes for the QE_LogonProperties which is part of the main property bag
    PropertyBag innerPropertyBag = new PropertyBag();
    innerPropertyBag.Add("DSN", this.DSN);
    innerPropertyBag.Add("UserID", this.LoginName);
    innerPropertyBag.Add("Password", this.Password);
    innerPropertyBag.Add("UseDSNProperties", "true");
    // The attributes collection of the tables ConnectionInfo object
    PropertyBag mainPropertyBag = new PropertyBag();
    mainPropertyBag.Add("Database DLL", "crdb_ado.dll");
    mainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");
    mainPropertyBag.Add("QE_LogonProperties", innerPropertyBag);
    // Pass the database properties to a connection info object
    ConnectionInfo connectionInfo = new ConnectionInfo();
    connectionInfo.Attributes = mainPropertyBag;
    connectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
    connectionInfo.UserName = this.LoginName;
    connectionInfo.Password = this.Password;
    // Replace the database connection properties of each table in the report
    foreach (RAPTable oldTable in this.report.ReportClientDocument.DatabaseController.Database.Tables)
        RAPTable table = new RAPTable();
        table.ConnectionInfo = connectionInfo;
        table.Name = oldTable.Name;
        table.QualifiedName = oldTable.QualifiedName;
        table.Alias = oldTable.Alias;
        this.report.ReportClientDocument.DatabaseController.SetTableLocation(oldTable, table);
    this.report.VerifyDatabase();
    Thanks again Ludek for the help.

  • Scheduling Repot in InfoView - Dynamic Parameters.....

    If I have some parameters set as dynamic and I try to schedule the report through InfoView....the login prompt appears.  I do not want my users to have to log in ever.
    I have the database configuration set - To Use original database logon information from the report and To Use same database logon as when report is run.  When I view a report on-demand I don't get the prompt.
    Does anyone know how I prevent the login prompt from appearing when a report is scheduled and has dynamic parameters?  We do not want our users to have SQL id's to the database - only Infoview logins.
    Thanks in advance for your help!

    Hi Lisa,
    When you create a dynamic prompt in Crystal and save the report to enterprise a business view will be created in the repository automatically. This Business View will have a datasource associated with it (used to connect to and obtain the dynamic list of params from the DB).
    It is on this datasource that you need to manually code the login details and select do not prompt at runtime. You can do this by using the Business View Manager Tool. Best practise for managed reports is to create your dynamic lists first in Business View Manager not Crystal and then present these to your report developers - this will give you some central control over the lists.
    See Crystal Reports user guide/Business View administrator guide.
    Hope this helps.
    James

  • Using JOIN Function with NULL Dynamic Parameters

    I have a report with utilizes dynamic parameters but will not run if any of the parameters are null.  I am also using the JOIN function to print out the values of these parameters. If the user doesn't enter in all the parameters, can the report still run?

    Hi eburton 
    In CR 2008 we have optional parameter functionality, this will allow the report to run without parameter values.
    If you are not using CR2008 then the functionality is not available.
    Thanks,
    Sastry

  • I'm getting the below issue when I try to deploy a report with Dynamic parameters, when I deploy it with static parameters I'm not getting this issue.

    I’m getting the below issue when I try to deploy a crystal report with Dynamic parameters in BI Launch Pad, when I deploy the same report with static parameters I can deploy and run it. I have Restarted the BI server, still the issue exitno use. kindly help me on this issue.
    “This error occurred: Adding Crystal Report "CrystalReport1.rpt" failed. The server with kind rptappserver returned an error result. Failed to copy the report file to the report object. Refreshing the report object properties might have failed. Failed to read data from report file CrystalReport1. Reason: Failed to read parameter object”.

    BO does not run dynamic params through the report as would happen without BusinessObjects (BO) or Crystal Reports Server (CRS).  When you publish a report with dynamic parameters to BO/CRS, the prompt is published to the repository so that it can be accessed through the Business View Manager (which can be installed as part of the client tools).  In order for this to work a couple of things need to happen:
    1.  You need to be sure that you check the "Update Repository" box on the Save As screen the first time you publish the report.
    2.  Your BO/CRS user needs to have "view" access to the Crystal2013ReportApplicationServer in the Servers section in the CMC - in fact, the Everyone group should be given view access to the server in order for dynamic prompts to work correctly.
    3.  In the Business View Manager, the Administrator user needs to give your user, or, even better, a Crystal Developers group full control access to the "Dynamic Cascading Prompts" folder.
    Best practice for dynamic prompts in a BO/CRS environment is to actually create the prompts in the Business View Manager.  This will allow you to create a single data connection that can be reused and also create lists of values such that the same list or prompt can be reused by multiple reports.  If you just create the prompts in Crystal, you will end up with multiple data connections to the same database, the prompts will use the whole query for the reports to get the dynamic values instead of just a focused query to the lookup table that contains the values, and there ends up being lots of duplication and chaos.
    -Dell

Maybe you are looking for

  • Pivoting using Model Clause Vs pivoting using Aggregate Fun(Case) statement

    Hi, I just wanted to know which option is better for pivoting the data if the data is like: Grp1 Grp2 Day_week Sales 1 1 Sun 200 1 1 Mon 100 1 2 Sun 1000 and so on... The output should be: Grp1 Grp2 Sun Mon ...... 1 1 200 100..... 1 2 1000 NULL.... I

  • PC iCloud Mail and 'Parent Approval' on child purchases.

    Hi, I'm running Windows 7 Premium, I've installed iCloud and I can see all the various iCloud applications in my 'Applications' window.  I attempt to login to iCloud mail, and the login page appears, I enter my login information (that works on my iPa

  • What software do I need to use an iiyama hm903dt monitor?

    How can I use my Iiyama monitor with a macbook air? what driver do I need?

  • Pictures using a lot of space

    Guys, I need some help! I was checking the space at my Macbook Air and then I saw that I am using 13 GB of pictures. I am pretty sure that I don't use all this space for pictures but I can't find where this space come from! I cleaned already the tras

  • MQ JMS adapter does not work

    Hi Experts we are using PI 7.1, we have deployed MQ 6.0 libraries via com.sap.aii.adapter.lib.sda. I have a scenario HTTP --> XI --> MQ JMS configured. At first, I forgot to specify user name / password, in RMB I got error of security authentication,