Not working. Change database location trough VB 6

Hi,
I just finished two reports in Crystal 10 using an Access Database (database  location and query are hardcoded in the reports.
I made a small vb 6 application to launch the reports. Now I need to change database location for the reports trough VB 6.  I have the following code, but it is not working. The reports do not show any data and I do not get any error. I think the problem is with the hardcoded query. The report is designed on this query and the field reference on the reports are like Command.Field1
I just want tho change database location in VB, but I want the report take the query that is in it.
I have the following code. How can I make them work.? Is there a better way to do it?
Dim Report As New CR2 'set up the report
Dim conn3 As New ADODB.Connection  'ADO connection
Dim rs As New ADODB.Recordset      'rs connection
Function F_ViewReport()
'On Error GoTo End_FormLoad
    Dim sSQL2 As String
    gsRootJob = "4850"
    Dim sSQL2 As String
    gsRootJob = "4850"
"SELECT Material.Job, Material.Indicator, PO_Detail.Order, Source.Act_Qty,  Vendor.Name, PO_Header.PO, PO_Detail.Due_Date FROM (((Material LEFT JOIN Source ON Material.Material_Req = Source.Material_Req) LEFT JOIN PO_Detail ON Source.PO_Detail = PO_Detail.PO_Detail) LEFT JOIN PO_Header ON PO_Detail.PO = PO_Header.PO) LEFT JOIN Vendor ON PO_Header.Vendor = Vendor.Vendor WHERE (((Material.Job) Like '" & gsRootJob & "*')) ORDER BY Material.Job, PO_Header.PO, PO_Detail.Line;"
    Report.DiscardSavedData
    Set conn3 = New ADODB.Connection
    conn3.Open "provider=Microsoft.jet.OLEDB.4.0; Data Source=" & App.Path & "\Data tables.mdb"
    Set rs = New ADODB.Recordset
    rs.Open sSQL2, conn3, adOpenKeyset, adLockReadOnly
    Report.Database.SetDataSource rs, , 1
    CRViewer2.ReportSource = Report
    CRViewer2.DisplayTabs = False
    CRViewer2.ViewReport
    CRViewer2.Zoom 1
    Screen.MousePointer = vbHourglass
Please help!
cc

Hi Cris,
It seems that you are having issue with SDK's.
Post your question in SDK forum.
[SAP Crystal Reports, version for Visual Studio;
You can download samples from here:
[https://www.sdn.sap.com/irj/boc/samples]
That forum is monitored by qualified technicians and you will get a faster response there. Also, all SDK queries remain in one place and thus can be easily searched in one place.
Thank you for your understanding,
Regards,
Shweta

Similar Messages

  • Issue with changing database location at runtime

    I am having a similar issue to:
    Re: Issue with changing database location at runtime
    where I am using Crystal Reports 2008 SP 3 fix pack 3.3 and a OLE DB connection to a SQL 2008 R2 server. Running on a computer on the network where the report can see the original development server is fast, other computers where that server is not available are hanging 20 seconds before coming up.
    I am using the same code from the Crystal Sample app to change the connection on each table. I found that the slowness comes the first time the ReportDocument object is accessed to get the collection of database tables, before the connection info is set.
    Fix pack 3.4 was mentioned in that post.  Does fix pack 3.4 fix that issue? I don't see fix pack 3.4 on the downloads page (https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/bobj_download/main.htm)

    I just found on the reports that were having the issue there was a SQL Expression.  Per this thread:
    Re: Report load is slow after changing database servers
    There was an issue with that and the fix is not out til the end of Feb so I found a way not to use the SQL Expression and the speed is much better.
    However, your information provided led me to this post:
    Cannot Change Table Location, but Only for One Report
    And I am also experiencing an issue where the table location is not changing on one subreport and I will look into that as a possible solution.
    Thanks so much for your help.

  • Perl command not working throgh database.

    Hello,
    I am using perl command to convert unix format to dos format.
    I have written perl command in shell script and call shell script though database.
    Suddenly perl command is not working though database call.
    I can convert file using perl command through command promt.
    What could be the issue?

    user10540254 wrote:
    What could be the issue?Environment. When making that o/s call to run the perl script from inside Oracle, an external o/s process is created. This process executes the perl script. This process needs a valid environment (e.g PATH variable and others) in order to find the Perl run-time system, the required commands and libraries and so on.
    If the process does not have a valid environment, it will fail. You can test that manually by logging on to the server, and running the command unset PATH before executing the Perl script.
    One approach to this, is not to call something like the perl script directly. Instead create a shell wrapper script. In this script set a valid environment and then have it execute the perl script with the required command line parameters. Typically a shell script can always be executed (despite minimal environment settings), as long as you fully qualify the location (path) of the script.

  • Session per user = 1 is not working in database ?

    Dear All,
    A profile has been configured on database with parameter session_per_user=1 but it is not working on database.
    user can make n number of session to database . what could be the reason profile is not working ?
    Please sugeest the solution .....
    Regards,
    Rajesh
    Edited by: Rajesh.Rathod on Mar 17, 2009 3:34 AM

    You have to alter resource_limit to true
    Look fo rmore details in metalink note 745752.1

  • SD Set top box not working in one location. Just displays 4 dashes in place of the time.

    At first this Motorola STB just had the lower third program info displayed and no video from the channel itself and in place of that was a screen that said "This channel not available" this on all channels; then screen went blank. I tried a working STB from another bedroom in place of this one and it did not work at this location either. So am not sure what is going on. Any help appreciated, thanks.
    Solved!
    Go to Solution.

    bozey45 wrote:
    At first this Motorola STB just had the lower third program info displayed and no video from the channel itself and in place of that was a screen that said "This channel not available" this on all channels; then screen went blank. I tried a working STB from another bedroom in place of this one and it did not work at this location either. So am not sure what is going on. Any help appreciated, thanks.
    Sounds like a bad cable.  If you have a splitter at the bad location, try removing it.  I would also try the suspect box in the working location to confirm both boxes are good. Then you have to decide if you want to try fixing the cable yourself or pay Verizon to do it.

  • Mapping Warning as cause of changing database location

    hello group,
    i am new in working with owb 10.2, so please forgive me trivial questions.
    now to the problem:
    i set up a location for my database, created some mappings and deployed them successfully.
    yesterday i got new connection details for accessing the database, then i registered/unregistered the location in the control center manager (was that right?).
    then i created some new mappings which use tables of the database.
    when trying to deploy the new mappings (action:create) i get this error-message.
    None
    INFORMATIONAL
    ORA-04052: error occurred when looking up remote object [email protected]@SRC_domain
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02019: connection description for remote database not found
    MY_FIRST_MAP_mytable
    Create
    Warning
    ORA-06550: line 0, column 0:
    ORA-04052: error occurred when looking up remote object [email protected]@SRC_domain
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02019: connection description for remote database not found
    what does this mean?
    was the way to change the location settings for the database wrong? or can this be achieved?
    can you give me some hints?
    thanks in advance,
    sven

    When you deploy a Connector you are creating a Database Link in the schema you are deploying the connector.
    With the replace option, you drop the database link and create it again, so all the objects referring the database link will be in "invalid" status, and you'll have to deploy them again (normally all the mappings, procedures and functions using the connector-databaselink).
    If you change the location information, sometimes the name of the databaselink created when deploying the connector change, OWB creates the database link using not only the name of the connector, includes some information of the location properties, so the replace option partially fails, because the drop database link sentence fails, the create database link sentence works properly, though, and in the database you have two db-links: the old one and the new one, so if you aren't aware to deploy again the objects using the old db-link to refer to the new DB-Link, they will stay referring to the old one. For example:
    The old information of LOCATION_SOURCE:
    HOST: host1
    PORT: port1
    SID: sid1
    When you deploy the connector MY_CONNECTOR in location LOCATION_TARGET referring the schema SCHEMA_TARGET, you create a DB-Link in SCHEMA_TARGET named SID1@MY_CONNECTOR
    If you change the information of LOCATION_SOURCE:
    HOST: host2
    PORT: port2
    SID: sid2
    And then deploy MY_CONNECTOR again, you create a new DB-Link in SCHEMA_TARGET, named SID2@MY_CONNECTOR, and with the REPLACE option you don't drop the SID1@MY_CONNECTOR DB-Link so all the objects referring to this old DB-Link will be valid, but referring to an incorrect DB-Link.
    Hope I've been able to make myself understand, I've read what I have written and seems a bit confusing. Regards.
    ANA GH

  • Changing database location per Table at runtime is extremely slow in viewer

    We are using the Crystal Reports 2008sp2 Viewer in windows forms .NET
    application to display various reports based on a Pervasive database.  The
    C# code dynamically changes the database table locations at run time.  The
    location needs to be set for each table since the location may be different
    for each table in the report. 
    We have tried to methods to change the location.
    1) Set  the Table.Location property in the ReportDocument.Database.Tables
    collection.
    foreach (Table table in rd.Database.Tables)
    Table.Location = "New Path";
    2) Set the TableLogOnInfo properties.
          TableLogOnInfo logonInfo = new TableLogOnInfo();
          logonInfo = table.LogOnInfo;
          logonInfo.ConnectionInfo.ServerName = dataPath;
          logonInfo.ConnectionInfo.LogonProperties[0] = new NameValuePair2("Data
    File", dataPath);
          logonInfo.ConnectionInfo.LogonProperties[0] = new NameValuePair2("Data
    File Search Path", path);
          table.ApplyLogOnInfo(logonInfo);
    Both of these methods work, but have extremely slow performance.  Both
    methods take between 2 and 3 seconds to execute per table.  Since many of
    our reports have 20 - 30 table references ( sometimes more ), this can add
    an additional 1-2 minutes to the display of a report.
    It seems that the Crystal viewer object is doing some sort of verification
    every time the database location is changed.  We have noted that as the
    location is changed, the database is being accessed by the viewer.  Please
    advise as to how to stop this behavior.  Is there a way to set the location
    without the viewer verifying the change?
    This problem is turning reports that run in the 2008 Report Designer in 3 seconds into reports that take
    many minutes to run.  We will hear nothing but screaming from our 300 customers.
    Thanks for any help.
    Bill Smith

    Hello,
    I have a very similar issue but with Crystal XI and XI R2.
    I'm using Oracle 10g, and changing a couple of properties using the following sequence for each table to change the login information and the table's current view (each view is a portion of the overall table):
    IDatabaseTablePtr table = tables->GetItem(tableN);          
    table->SetLogOnInfo(TheApp.GetDataSource(), TheApp.GetDatabase(), userID, pwd);
    char tableLocation[201];
    char tempTable[201], newTable[201];
    strcpy(tableLocation, table->GetLocation());
    // make new table name, put into newTable
    table->PutLocation(newTable);
    if (!table->TestConnectivity())
      ShowCrystalRE_Error(job);
    Stepping through in my debugger, the SetLogOnInfo seems very quick, it's the PutLocation( ) that seems to be taking alot of time.
    Any help would be greatly appreciated.
    This is extremely fast on SQL Server, only noticeably slow on Oracle.

  • SAP Mobile app Stock photo not work for network location

    Hi Experts
    I found if we use network location path (e.g.
    servername\pic folder\) in SAP Business One General Settings -> Path, Picture Folder, then if we logon SAP B1 Mobile app from iPad/iPhone, and try to open stock photo, we will get error:
    Processing Failed
    Internal server error: contact your system administrator
    It looks like it only work for local path, e.g C:\pic
    Even we put path as :
    local pc name\pic folder, it is also not work.
    Any idea about this?
    Thanks
    Tim

    The first link is a temporary fix for a machine that only one or two people will use. This will not fix the Library Machines that some 3000 users can use at anytime. I can not pre-add all these users every time we image a machine. We also loan out laptops and I need these machine to wirelessly login dynamically to the domain. But I also need these machine to allow access if these machine are removed from our campus and the wireless access is not available.
    Thank again for the help and I hope someone at Apple can fix this soon. I going to have a hard time telling the client that thay can not use the OS that came with they're machine.

  • My MacBook Pro will connect to WiFi but will not work in one location but will at others. I have the same issue with my IPhone 4S at the same location.

    My MacBook Pro will connect to Wifi at one location (this is a secure location) but will not allow access to the internet.  I will put in the password but will not display page.  Other wifi capable devises do not have this issue but my Mac and my Iphone 4S will not work.  I have tried restarting the router.  All other wifi locations I have been to have not had this issue.  Any suggestions? I am realtively new to Apple products (less than a year) so any advise is greatly appreciated.

    The other devices that are working got on with the same password.  It says it is connected.  Just nothing works on the internet.

  • Powerbook g4 charger not working, changed fuse and still no luck

    I've got a powerbook g4 laptop. A few nights ago the charger just stopped working. The wire is totally intact and we have tried changing the fuse within the plug but it keeps fusing out and still not working. I really don't want to buy a new charger as I've bought at least 6 over the last 5 years (through the wire fraying) AND replaced the battery once already. Is there anything I can do to fix it?
    Thanks!

    You must be remarkably hard on your adapter cords. I packed my Powerbook and adapter up and unpacked them again at least daily for six years and my original adapter is still working fine.
    If the port to which the adapter cord connects in your Powerbook is at all loose or wobbly, your DC-in card is shot, and that may explain why your fuse keeps blowing. If you're in the habit of tripping over your adapter cord, that would explain both the long sequence of ruined adapters and a broken DC-in port/card in the computer.
    Unless you plan to treat your adapter more gently in the future, buying an inexpensive third-party adapter instead of an Apple unit would be a good idea.
    http://eshop.macsales.com/item/Other%20World%20Computing/ACADPTG4/
    Message was edited by: eww

  • Wireless not working - can't locate servers on more than one network

    I am having a really strange problem with my wireless on my iBook that I'm hoping someone out there has had before, or has ideas for fixing.
    This began a few days ago. My computer could get on wireless networks, but when I tried to use my web browser, it couldn't locate any servers. I at first suspected it was the network that I was using that was the problem, but I've since gone to several cafes and my university to try to use their internet. I get this problem about 50% of the time, despite the fact that others are using the same networks with no problems. Sometimes a network will work on and off (ie it will work fine at first, then not be able to locate servers) and sometimes they never work at all.
    I'm wondering if there's any kind of reinstallation or resetting of settings that I can do short of reinstalling OS X (or if a reinstall would even work). Does anyone have a suggestion for me? Again, I have already determined that it's not the networks I'm using that are the problem (and I don't have my own internet, and can't go fiddling with router settings at the cafes around me!).
    iBook G4   Mac OS X (10.4.9)  

    JerryMc, Welcome to the discussion area!
    Is the AirPort Express (AX) the only router you have? If so, you need to make sure that it is configured to "share a single IP address".

  • Changing Changing Database Location During Runtime

    I'm using Netbeans 6.0.1. My database location ALWAYS change in place. That's why I'm planning that there would be a "Database Settings..." inside my program. But I don't know how to change the current: user, password, url settings of my program DURING RUNTIME. Here's my persistence.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="LibraryPU" transaction-type="RESOURCE_LOCAL">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <class>desktopapplication2.Books</class>
        <properties>
          <property name="toplink.jdbc.user" value="root"/>
          <property name="toplink.jdbc.password" value="password"/>
          <property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/Library"/>
          <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        </properties>
      </persistence-unit>
    </persistence>

    To solve the "why the hell would I want that stuff inside a jar file" issue, I googled a bit and found this
    style of approach in a Oracle forum. Essentially think of the persistence.xml file as an template
    that the program uses.
    I use a properties file to set all local DB configuration aspects. Load the properties at application
    startup and set then extract the required fields into a Map to create the persistent unit.
    All the "examples" I seen always use a static xml which is never what you need in the real
    world.
    Map properties = new HashMap();
    properties.put(TopLinkProperties.JDBC_URL, dbProps.getString("abc.jdbcurl") );
    properties.put(TopLinkProperties.JDBC_DRIVER, dbProps.getString("abc.jdbcdriver"));
    properties.put(TopLinkProperties.JDBC_USER, dbProps.getString("abc.user"));
    properties.put(TopLinkProperties.JDBC_PASSWORD, dbProps.getString("abc.password"));
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("abcPU", properties);
    entityManager = emf.createEntityManager();
    HTH Altimes.

  • Oracle Streams not working after database restart

    Hi,
    I am new at this so hope that somebody out there can give me some guidance.. I have managed to setup the streams properly on both my 10g database as per the scripts given in StreamsAdminConfig.sql and StreamsSetup.sql.. It worked beautifully on both direction.
    However when i restarted DB1.. suddenly the replication become just one directional only, namely from DB1 -> DB2. I have tried to do DBMS_STREAMS_ADM.STOP_APPLY, STOP_CAPTURE, START_APPLY, START_CAPTURE many times on both DB1 and DB2 but still it works only in one direction.
    Later I tried to restart both databases and not it does not work at all (both direction).. Tried restarting the apply and capture process many times too but get no success. Any idea what I could check or try to find out what when wrong. Thanks.
    regards,
    thamch

    trying viewing the status and error messages in views
    dba_apply, dba_apply_error, dba_capture and dba_propagation at both databases.

  • The Enter Key does not work in the location bar; I have to manually select the "Go To" icon since upgrading to Version 10.

    I just upgraded to Firefox 10. When I manually enter a URL into the location bar, the "Go To" arrow does not have focus, so the Enter Key will not work. I have to manually select the "Go To" arrow to navigate. Any suggestions?

    This could be the AVG safe search extension. If you have that installed, try disabling it. Instructions here: [[Using extensions with Firefox#w_how-to-disable-or-remove-extensions]]

  • Table "StoredProcedure" not found when changing Database location in VS 2005.

    <p>I&#39;m having a problem changing the datasource location when generating a report using the report viewer in VS2005.  If the table is a stored procedure, I get the message "Table (StoredProcedureName) not found", but if the report references tables rather than a stored procedure the location is changed and the report runs successfully.  The same problem was reported in earlier versions of Crystal Reports and was fixed in a service pack, but I couldn&#39;t find any documentation on the VS2005 version. </p><p>Does anybody know how to fix this problem?  I am using CrystalDecisions.CrystalReports.Engine.dll version 10.2.3600.0 and SQL Server 2000.</p>

    Peggy, I wonder if getting the latest SP for CR 10.2 will be better for now. SP 1 can be downloaded from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
    I\Let us know if that does not resolve the issue and we'll take a closer look before going all the way to CR XI.
    With regards,
    Ludek

Maybe you are looking for

  • In Firefox4, can I lose the folder icons from the Bookmarks Bar while keeping icons everywhere else (because the folder icons are superfluous and extend the horizontal list of bookmark folders beyond the width of the window)?

    I've just installed Firefox4 for Mac (OS 10.6.7) and can no longer see all my bookmark folders at once across the top -- because the folder icons make the Bookmarks Bar too wide. Yet, I like the icons on the other bars, so I don't want to turn them o

  • Regarding URL Creation

    I want to submit a request to action class Lookup.do with in the Portal context. I have a struts portlet associated with the Lookup action. How to create portal url for Lookup action in the following jsp. <%@ page language ="java" import="javax.portl

  • Oracle9i Developer Suite

    Hello to all, I download Oracle9i Developer Suite, but I'm having problems to install. When I downloaded, there were 10 files, File 1 (100,000,000 bytes) File 2 (100,000,000 bytes) File 3 (100,000,000 bytes) File 4 (100,000,000 bytes) File 5 (100,000

  • BSP iviews in BP

    Hi, I have installed "Business Package for Sales mySAP ERP 2004 60.1" in portal. ITS based iviews are working fine, where as the BSP iviews are not working. When I check in SE80, for the BSP application "sls_worklist", some of the pages like customer

  • IPhoto Exporting bug ?

    Ok lets see if I can explain this I haven't seen this problem before and I have over 10,000 photos in iPhoto, I imported from my cameras memory card 25 images some portrait, and some landscape none of them edited yet so no changes to the original fil