> Private Sub PrintReport(by val intBolNo as Integer)
> Dim CrxApp As CRAXDRT.Application
> Dim CrxReport As CRAXDRT.Report
> Dim sReportPath As String
> Set CrxApp = New CRAXDRT.Application
> sReportPath = "\\terminal_svr01\Solomon IV\usr_rpts\bol.rpt"
> Set CrxReport = CrxApp.OpenReport(sReportPath)
> CrxReport.Database.Tables.Item(1).SetLogOnInfo "DNS_NAME", "DB_NAME",
> "userID", "password"
> CrxReport.DiscardSavedData
> CrxReport.ParameterFields(1).AddCurrentValue (intBolNo)
> CrxReport.PrinterSetup frmBOL2.hWnd
> CrxReport.PrintOut
> The thing that threw me at first is the intellisense for SetLogInInfo is a
> little confussing. I was putting the name of the database instead of the
DNS
> name in the first parameter. That was incorrect but I think it is driver
> specific. I am using pdsodbc (ODBC)
> > Your report won't save log-on credentials.
> > You need to call SetLogonInfo method for each individual DatabaseTable
> > object, assuming that you are connecting by ODBC.
> > If you are connecting to SQL Server natively, then you need to call
> > LogOnServer method.
> > > I did it in the report not in the code. How do I set this
> > > in the code then ?
> > > Ak
> > > >-----Original Message-----
> > > >Where is the code you have used to point to your SQL 2000
> > > Server?
> > > >> I already have the report pointing to the table on SQL
> > > >> server 2000!
> > > >> >-----Original Message-----
> > > >> >This question has been done to death on this NG. Have a
> > > >> look at past posts
> > > >> >dealing with this issue.
> > > >> >In your case, it looks like you haven't used any code
> > > to
> > > >> point your tables
> > > >> >within your report to SQL 2000 Server.
> > > >> >> can anyone help with this please, I'm getting "Server
> > > >> has
> > > >> >> not yet been opened" error
> > > >> >> when I leave the DiscardSavedData line into referesh
> > > >> the
> > > >> >> data.
> > > >> >> I noticed this worked fine if I'm connecting to SQL 7
> > > >> but
> > > >> >> get this error with SQL 2000 (on different machines
> > > same
> > > >> >> code!)
> > > >> >> code sample below
> > > >> >> DIM Report As New CRAXDRT.Report
> > > >> >> DIM ReportApp As New CRAXDRT.Application
> > > >> >> Set Report = ReportApp.OpenReport
> > > ("rptfile.rpt")
> > > >> >> Report.DiscardSavedData
> > > >> >> form1.CRViewer1.EnableRefreshButton = True
> > > >> >> form1.CRViewer1.ReportSource = Report
> > > >> >> form1.CRViewer1.ViewReport
> > > >> >> Ak
> > > >> >.
> > > >.