Convert Database Driver on the fly
Posted on 2004-03-31
I have a report in designed in access 2000. Usually I convert the report to Sql Server 2000 using the RDC ( Database-> Convertdatabasedriver) and give Server,Database,userid,pass. So the report now is converted to SqlServer.
Actually I want to run the convertdatabasedriver on the fly.
I didnot find any of the solution through forums in Internet.
Can any please send /post your solution with simple code which can work..
Dim report As CRAXDRT.report
Dim crxApp As CRAXDRT.Application
Dim I As Integer
Set crxApp = New CRAXDRT.Application
Set report = crxApp.OpenReport("D:\Maintenance\Reports\Test.rpt", 1)
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
For Each crxDatabaseTable In report.Database.Tables
if dat="Access" then
crxDatabaseTable.SetLogOnInfo "", "Maintanance.mdb"
Elseif dat="SQLSERVER" then
crxDatabaseTable.SetLogOnInfo "Yassin", "Maintenance", "sa", "nitco"
CRViewer1.ReportSource = report