|
-
Aug 25th, 2008, 04:22 PM
#1
Thread Starter
Hyperactive Member
connect to server at run time(CR9,Sql 2000,Vb6)
I have a report connected to server1 at design time. Now I need use this report on different servers. So, I want to set connection to different server(server2, server 3) at run time but I failured.
Here is what I have done.
Code:
Dim strSelection As String
'CR9 stuff...
Dim crReport As New CRAXDRT.Report
Dim crApp As New CRAXDRT.Application
strReport = gsTrak & "\Reports\Summary_Report.rpt"
strSelection = "{Summary_Reason.RS_Date} = Date (strDate)
Set crReport = crApp.OpenReport(strReport)
crReport.RecordSelectionFormula = strSelection
crReport.Database.LogOnServer "p2ssql.dll", "Server2", "Trck", "sa", ""
If optPrint(0).value = True Then
' Print to screen
frmCR9Report.ReportFile = strReport
frmCR9Report.SelectionCriteria = strSelection
frmCR9Report.CRV9.ReportSource = crReport
frmCR9Report.CRV9.ViewReport
frmCR9Report.CRV9.DisplayGroupTree = False
frmCR9Report.Show
Else
' Print to printer
crReport.PrintOut False
End If
The red line is newly added. but it didn't do anything. Can anyone help me out? Thanks a lot in advance.
-
Aug 26th, 2008, 08:39 AM
#2
Re: connect to server at run time(CR9,Sql 2000,Vb6)
Does it produce an error or just not do anything at all?
-
Aug 26th, 2008, 08:55 AM
#3
Thread Starter
Hyperactive Member
Re: connect to server at run time(CR9,Sql 2000,Vb6)
 Originally Posted by Hack
Does it produce an error or just not do anything at all?
Thanks, Hack.
No error, and do nothing.
-
Aug 26th, 2008, 09:05 AM
#4
Re: connect to server at run time(CR9,Sql 2000,Vb6)
Given that I don't know what p2ssql.dll does (I can only guess), I really can't point to anything specific.
You said you wanted to try different servers....is the result that same no matter what server you try?
-
Aug 26th, 2008, 09:16 AM
#5
Thread Starter
Hyperactive Member
Re: connect to server at run time(CR9,Sql 2000,Vb6)
 Originally Posted by Hack
Given that I don't know what p2ssql.dll does (I can only guess), I really can't point to anything specific.
You said you wanted to try different servers....is the result that same no matter what server you try?
You are right. the result is the same no matter what server I connected.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|