Sitemap

Amicuk Programming Answers

How to change Crystal Reports XI database name at run time from ASP code using ADO

2015-10-11   Views:2

Advertisement

Dear All, I need advises regarding to my problem below I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page. The problem is ho

Dear All,
I need advises regarding to my problem below
I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page.
The problem is how can I change a database from TEST01 to LIVE01 at the run time from ASP code as I already using TEST01 database on Crystal Reports and I do not want to set a new database location inside crystal for each reports
Thanks and wait for your reply soon.
Below is my code, which has no effect to crystal reports although I've change the database from TEST01 to LIVE01:
<%
Dim oADOConnection, oRptTable, oADORecordset, sql
Dim struser, strpwd, strdriver, dblocation, dbname, strConnect
struser = "sa"
strpwd = ""     
strdriver = "{SQL SERVER}" 
dblocation = "SQL200501"     
dbname = "LIVE01"    ' Changed from TEST01 to LIVE01
strConnect = "User Id=" & strUser & ";"
strConnect = strConnect & "PWD=" & strPwd & ";"
strConnect = strConnect & "DRIVER=" & StrDriver & ";"
strConnect = strConnect & "SERVER=" & DBLocation & ";"
strConnect = strConnect & "DATABASE=" & dbName
sql="Select * from Employee"
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
Set session("oRpt") = session("oApp").OpenReport("C:\REPORTS\RPT01.RPT", 1) 'USING TEST01 DATABASE
session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
session("oRpt").DiscardSavedData
Set oADOConnection = Server.CreateObject("ADODB.Connection")
oADOConnection.Open (strConnect)
Set oADORecordset = Server.CreateObject("ADODB.Recordset")
Set oRptTable = session("oRpt").Database.Tables.Item(1)
oRptTable.SetDataSource oADORecordset, 3
session("oRpt").SQLQueryString = CStr(sql)
session("oRpt").ReadRecords
%>

The replay answer
Advertisement
Did you ever find a solution to this problem?  I have the same problem when moving reports from development to Test to Production environments.  If the DBName is not the same the report ignores the name provided at runtime.

Go to See the other 2 answers

How to change Crystal Reports XI database name at run time from ASP code using ADO

Category:DefaultRelease time:2015-10-11Views:130

Dear All, I need advises regarding to my problem below I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page. The problem is ho[More]

Launch a Crystal Report Based on a Bus. Objects Universe with code

Category:DefaultRelease time:-0001-11-30Views:130

Post Author: BobM CA Forum: .NET Launch a Crystal Report Based on a Bus. Objects Universe with code We have purchased Business Objects Enterprise XI R2 and have designed a universe.  We have hundreds of scheduled reports that have been configured thr[More]

Crystal Reports 2008 runtime error while running on Windows Server X64

Category:DefaultRelease time:2015-10-11Views:130

I have a .NET web application compiled as X86 in Visual Studio 2008 invoking Crystal Reports 2008 SP2 that's running fine at a number of sites running Windows Server 2003 X86.</br> </br> When deploying this app to Windows Server 2008 X64 I get[More]

Unable to see Oracle driver from Crystal Report's Database Expert

Category:DefaultRelease time:2015-10-11Views:130

I have installed Oracle client (version 10g) on my laptop that also has Crystal Reports 2008 ver 1 SP3.  I then installed data driver 5.3 (Datadirect ODBC database driver) but I canu2019t see the Oracle driver nor the Oracle wire protocol driver from[More]

Crystal Report Server Database Log File Growth Out Of Control?

Category:DefaultRelease time:2015-10-11Views:130

We are hosting Crystal Report Server 11.5 on Microsoft SQL Server 2005 Enterprise.  Our Crystal Report Server SQL 2005 database file size = 6,272 KB, and the log file that goes with the database has a size = 23,839,552. I have been reviewing the Appl[More]

Crystal Reports: Unexpected database connector error

Category:DefaultRelease time:2015-10-11Views:130

Hi experts, I have a Web Module DC that uses JSP to show Crystal Reports. In my report I use POJO as datasource. The POJO itself is a JPA entity and is located in other EJB Module DC that has dependency with the Web Module DC. At design time everythi[More]

Crystal Reports Integration Database Login error

Category:DefaultRelease time:2015-10-11Views:130

Hi guys, We have installed crystal reports integration on our customer's server and client PCs. They are using SAP 2007 A PL10. We created a report and the report works perfectly on the server and on another client pc. There is however 3 clent pcs (a[More]

Crystal Report requests Database logon if SAP BW is datasource

Category:DefaultRelease time:2015-10-11Views:130

Hi all I experience the following: 1. SSO from SAP Portal to BOE works: I can view Sample Crystal Reports based on the BO-iView-template without additional login 2. SSO from SAP Portal to SAP BW works: a) I can view custom BW Web queries without addi[More]

Using excel file as datasource in crystal report asking database logon

Category:DefaultRelease time:2015-10-11Views:130

hai all, we uisng  plain excel file in crystal report to develop some reports it is working fine. Issue is when we are using  parameters and  using the crystal report in live office it  is asking for database logon details. we are not using any datab[More]

Crystal Report with subreports breaks when running on different databases.

Category:DefaultRelease time:2015-10-11Views:130

HI there I have a report with 5 subreports on that only works on the database I am designing it on. As soon as I run the report through my application on a database different to the one I design on, it seems to have lost all the parameter fields I cr[More]

Crystal Reports 2008 database error

Category:DefaultRelease time:-0001-11-30Views:130

I want to make a change to an already existing Crystal Report.  The database table(s) were specified with the "add Command" command and so the report uses an SQL command to access the tables. (An ODBC connection is used to access tables.)  When[More]

Hot
Hi all, I have to design a solution in order to modify the selected open items showed in the Process Open Items sheet. I mean, I want to clear 2 concert items (I know every feature for each one) but the selection criterion match some items else, so I [More]
how can i change my iTunes Country without the need of Credit Card? is it possible? if yes, then please tell me howstraight forward, thanks.Read other 3 answers [More]
I imported many video in 1080i format using Final Cut Pro, and when I play back them from quicktime I've got interlace problem. How can I have my video played back correctly ?And you are monitoring...how? Computer displays don't show interlacing prop [More]
I am running Mac OSX 10.7.5 and have both Quicktime 10.1 and Quicktime 7.6.6. I have paid for the upgrade to Quicktime Pro (to upgrade Quicktime 7.6.6 and have followed the directions (multiple times) and cannot seem to get the upgrade to kick in. I' [More]
New to the wireless concept--My G4 needs an airport card B4 I can get the Airport Express Base, then get my new Toshiba laptop and my usb Epson printer connected, AND get the laptop to internet. (I think this is the process?) I am concerned about com [More]
I have two functions called functionA() and functinoB(). As the play head travels down the timeline I'd like to call functionA() on frame 100, functionB() on frame 200, functionA() on 300, functionB() on 400 and so on. However, instead of having to t [More]
I bought a second-hand iPhone 4 that is locked with a certain carrier that is not my regular carrier. I tried the easiest route: I plugged it into my Mac and opened iTunes... hoping for a miracle that didn't happen. What I got was a message suggestin [More]
What is iTunes error code 2324?A search of google, these forums, or looking at the "More Like This" section to the right would answer that question.Read other 2 answers [More]
weeks ago i redeemed air miles to get itunes balance. now i want to see the credit balance. how do I do so..?Here >    Check the balanceRead other 2 answers [More]
I just purchased clash of clan gems for $4.99 but just looked on my online banking and I was charged $9.98Go here: http://www.apple.com/support/itunes/contact/ and follow the instructions to report the issue to the iTunes Store. Regards.Read other 2 [More]