Hi,

Use "LogonInfo" to change the SQL Database whenever at VB run time.

Originally posted by fetus
Hi,

please answer me as soon as possible.

I have used CR 9 to create report that uses SQL Server data.

Now I want in VB to change so that I get report for some other database server and database. Structure and table names are identical.

I neet solution that will work for SQL Server and that will be work for all my reports, so that I don't need to know what tables are used in report. Also I need to say that my report uses more than 20 tables.

How ?!! I have read about changing connection property but it doesn't work. What to insert * HERE *:

Dim crxApplication As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Dim strSel As String

Set Report = crxApplication.OpenReport("HZZO.rpt")

* HERE *

Report.DiscardSavedData

strSel = "{Stavke_raèuna_poliklinike.RacunBR} = '20030000001' "
Report.RecordSelectionFormula = strSel

cv.ReportSource = Report
cv.ViewReport

Server will be: gradp4
Database will br: Bis6Test
User: ime
Password: sifra
Connectivity technology: OLE DB

Thnx in advance.