How to change the path of an Access .mdb file @ runtime in Visual Studio 2012

Hello,
  I'm hoping my question is simple enough to merit a quick answer.  I will lay out the details:
  I am writing a WindowsForms App in VB 2012.  I have a Crystal Report that points to an Access .mdb at design time in order to get the proper structure and layout correctly.
  However, during runtime, I need to point to a completely different .mdb file with the same identical structure.  How do I do this?  I've tried everything I could find on the net with no success and mostly because the answers are for C programmers.  I mean, I can pretty much decipher it, but have gotten zero results.
  Thank you for your time.
-Mike

ok. The code needs some small modifications.
I gave it a quick try and here is the InProc RAS SDK code which works for me. Add the assembly references to the app for all those assemblies used in the 'imports' statements in the code.
Imports CrystalDecisions.ReportAppServer.ClientDoc
Imports CrystalDecisions.ReportAppServer.DataDefModel
Imports CrystalDecisions.ReportAppServer.ReportDefModel
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Web
Imports CrystalDecisions.Shared
Partial Class _Default
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ClientDoc As ISCDClientDocument
        Dim logonPb As New CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag()
        Dim table_Old As New CrystalDecisions.ReportAppServer.DataDefModel.Table()
        Dim table_New As New CrystalDecisions.ReportAppServer.DataDefModel.Table()
        'Open the report object to initialize the ReportClientDocument
        Dim rd As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
        rd.Load("C:\Users\Administrator\Desktop\Report1.rpt")
        ClientDoc = rd.ReportClientDocument()
        table_old = ClientDoc.Database.Tables(0)
        'Clone the original table in the report
        table_new = table_old.Clone(True)
        ' Get the connection information from the report document for the first table in the collection.
        logonPb = table_new.ConnectionInfo.Attributes("QE_LogonProperties")
'set the path for new mdb
        logonPb.Item("Database Name") = "C:\Users\Administrator\Desktop\New folder\efashion1.mdb"
        ' Set a new table for the report, set the old table to the new one.
        ClientDoc.DatabaseController.SetTableLocation(table_old, table_new)
        'view the report
        CrystalReportViewer1.ReportSource = rd
    End Sub
End Class
Hope this clears the doubts

Similar Messages

  • How to change the path of sysprep files that were copied to reference computer when i capture the image from reference.

    Dears ,,
    how to change the path that sysprep were copied to reference computer when i capture the image from reference.
    Should i modify some codes in LTIAPPLY.wsf? how to modify it?
    Thanks.

    Sysprep and capture has *Three* steps.
    1. Run sysprep on the local machine (easy).
    2. Copy WinPE down to the local machine so we can reboot into winpe for capture.
    3. Capture the drive in an *offline* state from within WinPE.
    What is most likely happening is that you are having problems with step #2. 100MB is *WAY* too small to copy down WinPE. By default MDT will make this System partition much bigger, 499MB. IF you install Windows 7 from the default media. IT will only create
    a 100MB partition.
    By default MDT 2012 Update 1 and greater *should* recover to a fallback drive with the OS on it, however if you are running older versions that might not happen correctly.
    If you are still having problems, copy your BDD.log file to a public share like OneDrive and copy the link here.
    Keith Garner - keithga.wordpress.com

  • How to change the path of the Transport

    HI all!
    I had the system of portal dev,qas,prd,I want to made the export folder of the dev point to the import folder of the qas.But how to change the path of the transport ?I change the file of the D:\usr\sap\dev\SYS\global\pcd\pcdStartup.properties,But it not useful.I think my type is not correct.Plz tell me the key.thanks very much!!!
    D:\usr\sap\dev\SYS\global\pcd\pcdStartup.properties,I changed:
    Transport Application
    Root directory for exporting transport packages
    #Pcd.TransportApplication.ExportRootDir=
    qas\Import
    Root directory for importing transport packages
    #Pcd.TransportApplication.ImportRootDir=${Pcd.Share}/Import
    Directory for temporary transport files
    #Pcd.TransportApplication.TempDir      =${Pcd.Temp}/transport
    Edited by: joecui on Nov 12, 2008 8:15 AM
    Edited by: joecui on Nov 12, 2008 8:16 AM

    Did you try to remove the "#" character before every line you changed?
    Save the file...
    Reload/Refresh it in the Portal...
    Try if that helps you.
    Cheers,
    Benjamin

  • How to change the path of MPLS

    How to change the path of MPLS core from one PE to the other PE with redundancy link? The IGP is OSPF and running MBGP among PE routers.

    Hi there,
    Load-balancing is applicable in MPLS as follows:
    If multiple equal-cost paths exist for an IPv4 prefix, the Cisco IOS can load-balance labeled packets. If labeled packets are load-balanced, they can have the same outgoing labels, but they can also be different. The outgoing labels are the same if the two links are between a pair of routers and both links belong to the platform label space. If multiple next-hop LSRs exist, the outgoing label for each path is usually different, because the next-hop LSRs assign labels independently.
    If a prefix is reachable via a mix of labeled and unlabeled (IP) paths, Cisco IOS does not consider the unlabeled paths for load-balancing labeled packets. (The load balancing is done only between labeled paths. This means that if an IP (unlabeled) and a labeled path have the same cost, only the labeled path is used to forward the packets.)
    HTH,
    Mohammed Mahmoud.

  • How to change the QueryRowSet in early access 2?

    hi everybody,
    I do know how to change the query but I want to add a condition on a variable got from a text field, and use by button action.
    I don't know where to initialize this variable exactly?
    provided that the query is created in the session bean.
    please, reply as soon as possible.
    thanx.

    Hi,
    The tutorials under the section Access Databases will answer your question. In particular the tutorial "Using Databound Components to Access Databases". These tutorials can be found at:
    http://developers.sun.com/prodtech/javatools/jscreator/ea/jsc2/learning/tutorials/index.html
    Please post any further Creator 2 EA 2 related queries at:
    https://feedbackprograms.sun.com/login.html
    Cheers
    Giri

  • How to change the value of variable in .bpel file

    Hi,
    How can i change the value of variable in .bpel file at time of deployment.
    Can it be possible with configplan.xml or deployment descriptor?
    Thanks
    Richa

    You cannot change the value of variable in .bpel file using config plan. If you want to change value at runtime , you can use Preference variable. Below is the blog to help you understand more.
    http://eelzinga.wordpress.com/2009/10/28/oracle-soa-suite-11g-setting-and-getting-preferences/
    Cheers,
    Durga
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • How can I export the query result into access(*.mdb) file?

    Dear all:
    I want to export the query result displayed in jsp into excel file
    and access file. And I have exported the result into excel format successfully, only one line should be added in the head of Jsp:
    <%@ page contentType="application/vnd.ms-excel; charset=gb2312" %>
    But how can I export it in access(*.mdb) file? I have replaced "excel"
    with "access". But it can't achive my goal.
    What should I do to achieve my goal?
    Thanks!

    The only reason your Excel export works is that Excel knows how to interpret comma separated values as an input file format. Access has no such beast.
    If you absolutely must provide info in an mdb, one solution would be to create an ODBC datasource pointing to an empty mdb, then push data into it using the jdbc:odbc bridge, then make a copy of the file and stream it down to the browser. You may run into some ugly file locking items here - set the ODBC connection so it is not shared, and that might help.
    This one is going to be ugly.
    I suppose another approach would be to write a simple VB applicatin that uses automation to create an MDB, then stream that file down to the browser from your servlet. That would almost certainly be faster than the ODBC approach.
    - K

  • How to change the path for dms repository in navigation iview

    Hi all,
    We integrate DMS in KM. With the documentexplorer iview we can navigate through the folders structure. So far so good.
    But for the end-user it will be easer if they can startright  from point X in the folder structure. Like dmsrm/aaa/bbb/..../X
    It's not possible to change the iview path property to dmsrm/aaa/bbb/..../X, preview shows the message  'Item nof found
    The item you are attempting to access is not available. Check that the name or link is correct. You might also check whether the associated repository is currently accessible'. For all the folders (except the root folder dmsrm) there is no acces link tab, so the ID, explorer URL and webdav URL are unknown. How to find out what the ID is?
    Thanks in advance,
    Vo

    Try going to Options > Global Preferences > Paths tab, you will see the User Settings.
    Nestor
    National Instruments

  • Microsoft ADFS / IIS : How to change the path of MSISAuth/MSISAuth1/MSISAuthentcation Cookies?

    Hi,
    I need to have the MSISAuth/MSISAuth1/MSISAuthentcation Cookies sent from a Browser to a Proxy upfront.
    But there are two issues:
    1) Cookies are set from MS ADFS to the host - not domain
    I solved that issue by editing the C:\inetpub\adfs\ls\web.CONFIG by including this setting:
        <httpCookies domain="mydomain.com" httpOnlyCookies="false" requireSSL="false"/>
    So the cookies got sent by the browser to all servers included in this domain - solved.
    2) Cookies are set to path /adfs/ls
    To have the browser sent the cookies the pattern https://<host>/adfs/ls
    need to be fullfilled - but now I need to change this path to "/" so that those cookies are also sent to other context roots.
    I have not found any documentation or property file to change this
    Anyone able to help me here by pointing me to the correct place to edit this setting?
    Thanks,
    Sascha

    Hi Sascha,
    Regarding ADFS specific issue, I suggest you refer to experts from the following forum to get professional support:
    Claims based access platform (CBA), code-named Geneva Forum
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=Geneva
    Thank you for your understanding and support.
    Best Regards,
    Amy

  • How to change the path for a file download? Sometimes, I want to save a file in a specific folder in my hard disc and I don't know how to do it. Thanks.

    There is a default folder for the download of files from the internet ("Descargas" or "Downloads"). But, what can I do if I wish to save the file in another location of the hard disk?
    Thank you.

    Use about:config and filter on browser.download, you'll see them
    '''More information on configuration variables''' available in
    [http://kb.mozillazine.org/About:config_entries about:config (entries)] and for users not familiar with the process there is [http://kb.mozillazine.org/About:config about:config (How to change)]

  • How to change the prompt message in a open file box

    Hello
    In my VI the user has to introduce several file path. They are sequenced so we know which one is requested. Is there an easy way to change the message on the "choose file to read" window in order to have "choose xxx file to read" etc... Is this through some VB programming or does labview have some tools for that ?

    There are two solutions:
    OBN's solution uses a function to get the file name.
    My solution uses the file control. You have to click on the browse button to select the file.
    Both solutions will open the system Open File dialog where the user can select the file. OBN's solution is more obvous to change the parameters. In my solution you have to use property nodes.
    See the VI (LV7.0) how my solution works.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions
    Attachments:
    Select File.vi ‏15 KB

  • How to change the replication group information after db files are created

    Since group information is persisted in the database, I am wondering if there is a way to update the information.
    We want to implement some kind of Berkeley DB master relay mechanism for our two data centers, which has slow link in between. Basically have one master populating a database file and launch another two node as master to replay that to other nodes of its own group. It will be much efficient this way so we don't have to copy the data multiple times over the slow link.
    We periodically (once a day) update the Berkeley DB content from customer's feed on a backend node and upload (rsync) the Berkeley DB File to two the data centers. We would like to have a master node in each data center to read the pre-populated data file, replicate the changes to the web node (read only) while they are still running. I simulated local and if I trick the nodeName and nodeHostPort setting, it should work (basically, fake the replication node on the backend node using tampered hostfile so they get registerred). However, it is not very convenient and definitely a dangerous hack on the production servers.
    If there is a way, after the creation, to update the group information (for example, change all the nodes information) without corrupt the log file/replication stream, it will be much easier for us. Basically, we would like to have the node/group information and data file de-coupled?
    Any ideas how to do that, or is there a better way to design such a replay of data using Berkeley DB?
    Thanks in advance!

    2. You mentioned to not clean up the log file. Is there a point where I can safely call clean up on the environment when BDB is still online as I can imagine we will run out of space very soon if we don't clean up.The approach outlined above (steps 1 to 5) will ensure that no log files are deleted on A while you are updating B and C. The use of DbBackup ensures this. For more information on how this works, see the DbBackup javadoc.
    Whether this causes you to run out of disk space on A is something you'll have to evaluate for yourself. It depends on the write rate on A and how long it takes to do the copy to B and C. If this is a problem, you could make a quick local copy of the environment on A, and then transfer that copy to B/C. But you must prohibit log file deletion during the copy, using DbBackup, or the copy will be invalid.
    You should perform explicit JE log cleaning (including a checkpoint) before doing the copy to B/C. This will reduce the number of files that are copied to B/C, and will reduce the likelihood that you'll fill the disk on A. See the javadoc for Environment.cleanLog for details on how to do an explicit log cleaning.
    In your earlier post, it sounded like the updates to A were in batch mode -- done all at once at a specific time of day. If so, you can do the copy to B/C after the update to A. In that case, I don't understand why you are afraid of filling the disk on A, since updates would not be occurring during the copy to B/C.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to change the argument input in a jnlp file?

    A question associated with the following few lines of jnlp codes:
    <application-desc main-class="Main">
    <argument>arg</argument>
    </application-desc>
    My question is: "How can 'arg' be changed dynamically?
    Thanks for help.

    Thank Dietz for help.
    I tried the following jsp code. But it can launch the application only when "test2.jnlp" file exists. "argument to change" can't be passed to the application.
    Thanks.
    <% response.setContentType("application/x-java-jnlp-file");
    out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    out.println("<jnlp ");
    out.println("spec=\"1.0+\" ");
    out.println("codebase=\"http://tang:8080/examples/rtla/\"");
    out.println("href=\"test2.jnlp\">");
    out.println("<information> ");
    out.println("<title>RTLAFrame viewer</title> ");
    out.println("<vendor>XXX, Inc.</vendor> ");
    out.println("<description>RTLAviewer Application Demo</description>");
    out.println("<description kind=\"short\">A viewer.</description> ");
    out.println("<offline-allowed/> ");
    out.println("</information> ");
    out.println("<security> ");
    out.println("<all-permissions/>");
    out.println("</security> ");
    out.println("<resources> ");
    out.println("<j2se version=\"1.3+\"/>");
    out.println("<jar href=\"test.jar\"/> ");
    out.println("</resources> ");
    out.println("<application-desc main-class=\"RTLAFrame\">");
    out.println("<argument>argument to change</argument>");
    out.println("</application-desc> ");
    out.println("</jnlp> ");
    %>

  • How to change the display ratio of a video file in OSMF

    Hi all
    The video file I want to play has an incorrect width and height embedded in the video meta file (if you get the metadata of that video file, the width and height are incorrect). I'm now able to get the correct width and height, but I don't know how to apply them to OSMF. I'm using the MediaContainer for video display, the default behavior of that container keeps the original (which is incorrect) ratio (get from the video metadata) even I set the width and height. I'd appreciate if anyone can provide suggestion on how to do it.
    Thanks.

    You can modify the OSMF library's ScaleModeUtils class to do this, here's the path:
    OSMF > org.osmf > layout > ScaleModeUtils.as .
    My code to implement the 16:9 and 4:3 ratios.
                                                     case ScaleMode.STRETCH:
                                                      result
                                                                = new Point
                                                                          ( availableWidth
                                                                          , availableHeight
                                                      break;
                                            case ScaleMode.NONE:
                                                      result
                                                                = new Point
                                                                          ( intrinsicWidth          || availableWidth
                                                                          , intrinsicHeight          || availableHeight
                                                      break;
                                                     // ****custom begin
                                            case ScaleMode.FourToThree:
                                                      var availableRatio1:Number= availableWidth/ availableHeight;
                                                      if(availableRatio1 > 4/3){
                                                                result = new Point( availableHeight * 4/3, availableHeight);
                                                      }else{
                                                                result = new Point( availableWidth , availableWidth * 3/4);
                                                      break;
                                            case ScaleMode.SixteenToNine:
                                                      var availableRatio2:Number= availableWidth/ availableHeight;
                                                      if(availableRatio2 > 16/9){
                                                                result = new Point( availableHeight * 16/9, availableHeight);
                                                      }else{
                                                                result = new Point( availableWidth , availableWidth * 9/16);
                                                      break;
                                            // ****custom end
    And then you can set the container's scalemode to apply a ratio:
    layoutMetadata.scaleMode = ScaleMode.STRETCH;
    Or
    layoutMetadata.scaleMode = ScaleMode.FourToThree;

  • How to change the "Download" word indicated for a File browse item ?

    Hi,
    I have a File Browse item. It displays "Download". And works fine too ! i want to change the Message "Download" by "Télécharger". Where can I find this ?
    Thank you for your kind help !
    Christian

    Hello Christian,
    If you are referring to the DOWNLOAD on an interactive report that is set to download a blob (for example), you can change the word Download to be anything you wish in the Download Format Mask. The very last entry is the Download Message.
    DOWNLOAD:TABLE_NAME:BLOB_CONTENTS_COLUMN:PRIMARY_KEY_1:PRIMARY__KEY_2:MIME_Type_COlumn:FILENAME_COLUMN:LAST_UPDATE_DATE:CHARACTER_SET:CONTENT_DISPOISITION:DOWNLOAD_LINK_TEXT
    For example:
    DOWNLOAD:TABLE_Of_CONTENTS:TOC_PAGES:BOOK_ID:::PDF_FILENAME:MOD_DATE::ATTACHMENT:Click Here To Download This Book
    The message "Click Here To Download This Book" will appear for each link.
    Good luck,
    Don.
    You can reward this reply by marking it as either Helpful or Correct :)

Maybe you are looking for