Chaging SQL Server database at run-time within a report in VB 
Author Message
 Chaging SQL Server database at run-time within a report in VB

Hi there,

I know this may have been asked many times before, but I have not found any
post regarding this particular yet.  I have found many talking about Access
database though, but not with SQL Server.

I have CR 8.5.  I have created a project, added a CR 8.5 designer to it,
created a report through the "Expert" wizard in VB (providing the SQL Server
DSN that it has to connect with), and tested it to verify the db connection
and data.  Ok, so far so good.

But now, since this program has to be distributed on different client sites,
the SQL Server database name will be different from one another.

I need a way to programatically change the database to point to the correct
SQL Server database (ODBC DSN) without having to change the code for every
client site I have distributed the program (this is very important).

The code looks like this (very simple):

Dim Report As New CrystalReport1

Private Sub Form_Load()

   Screen.MousePointer = vbHourglass
   CRViewer1.ReportSource = Report
   Screen.MousePointer = vbDefault

End Sub

Please, I know this can be done.  I am looking for the straight-forward
solution for this specific scenario, but any suggestion is accepted.

Many Thanks.



Wed, 26 Oct 2005 00:19:45 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Creating Access database from SQL Server at run time

2. Crystal Reports and asp- re: dynamically change servers and databases at run time

3. VB/SQL Server DTS Run-Time Problem

4. Running Crystal Report Web Component Server and SQL Server on different machines

5. server time reported on .asp web pages, how do I report client side time correctly

6. Run time error 3622: OpenRecordSet: SQL server table: IDENTITY column

7. Run-time error 20599: Cannot open SQL Server

8. SQL Server run-time files

9. Change SQL Server at run time???

10. How to create GUIDs for PK in SQL Server within VB

11. Create SQL Server DB from within VB

12. Running VB within a Report


Powered by phpBB® Forum Software