Board index » delphi » Connection - Delphi, MS SQL 2000 and Crystal Report

Connection - Delphi, MS SQL 2000 and Crystal Report


2005-09-15 06:16:14 PM
delphi136
Hi everyone
This problem is a bit confusing for me
Few weeks ago, we've started to use Crystal Report 11
For procedure testing, we MUST change
database name and server name,
To avoid recompile all reports, we are changing connect properties
from application with following code:
Crpe1.ReportName := OpenDialog1.FileName;
Crpe1.DiscardSavedData;
Crpe1.Connect.ServerName := 'SERVER';
Crpe1.Connect.DatabaseName := 'Sales';
Crpe1.Connect.UserID := 'Marta';
...
..
. etc
Code above does not work with MS SQL 2000,
Again, results are from original database
On the Internet, I couldn't find any text about this problem
Is there solutions for this
Thanx
Srdjan
 
 

Re:Connection - Delphi, MS SQL 2000 and Crystal Report

What was your original database that you would connect to ? SQL Server is
not a "file based" db like Access. You have to do 1 of 2 things. Connect
directly through OLEDB using a dialog box in Crystal. In this case, yes, you
have to redo all reports to match the database if the name or location
changes because Crystal keeps that kind of connection info within the
report. Or ... you can do this .. create an ODBC Connection and use that
connection to connect to a database. Then when you move the reports to
another server, you just have to make sure that the ODBC connection on that
new server (or datasource) points to the correct database.
 

Re:Connection - Delphi, MS SQL 2000 and Crystal Report

Quote
Is there solutions for this
Yes, see my reply to 'How to change MSDE database of Crystal report in D7'.
Basically you have to fill in the 'Overidden Qualified Table Name' in 'Set
Database Location'
hth,
Martin
 

Re:Connection - Delphi, MS SQL 2000 and Crystal Report

Hi
I don't know if this is true in Crystal 11 but we use 8.5 and have a similar
problem. I have found that, even using ODBC, the database name is appended to
the table names. In Crystal, if you go to Database, Set Location and look at
the table name in the location section at the bottom of the window you may
find it says something like dbo.MyDatabaseName.TableName. Remove the
dbo.MyDatabaseName. to leave just the table name. I have also found that it
can look fine here but when you check the SQL used under Database, Show SQL
Query, the db name appears here too. I have had to use the Reset button having
checked the set location dialog.
Simon
"Srdjan" <XXXX@XXXXX.COM>writes
Quote
Hi everyone

This problem is a bit confusing for me
Few weeks ago, we've started to use Crystal Report 11

For procedure testing, we MUST change
database name and server name,
To avoid recompile all reports, we are changing connect properties
from application with following code:

Crpe1.ReportName := OpenDialog1.FileName;
Crpe1.DiscardSavedData;
Crpe1.Connect.ServerName := 'SERVER';
Crpe1.Connect.DatabaseName := 'Sales';
Crpe1.Connect.UserID := 'Marta';
...
..
. etc

Code above does not work with MS SQL 2000,
Again, results are from original database

On the Internet, I couldn't find any text about this problem

Is there solutions for this

Thanx
Srdjan
 

Re:Connection - Delphi, MS SQL 2000 and Crystal Report

hi Martin
I couldn't find your post
Can you post it again or
send it to following e-mail address:
XXXX@XXXXX.COM
thanx againg
Srdjan
On Wed, 21 Sep 2005 05:41:46 +0200, "Martin Brekhof"
<XXXX@XXXXX.COM>writes:
Quote
>Is there solutions for this
Yes, see my reply to 'How to change MSDE database of Crystal report in D7'.
Basically you have to fill in the 'Overidden Qualified Table Name' in 'Set
Database Location'

hth,
Martin

 

Re:Connection - Delphi, MS SQL 2000 and Crystal Report

text bellow are not totally clear to me
do you mean, make a connection in Crystal and
manually change SERVER NAME inside of a connection
Srdjan
Quote
.... Or ... you can do this .. create an ODBC Connection and use that
connection to connect to a database. Then when you move the reports to
another server, you just have to make sure that the ODBC connection on that
new server (or datasource) points to the correct database.