Results 1 to 5 of 5

Thread: connect to server at run time(CR9,Sql 2000,Vb6)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    313

    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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: connect to server at run time(CR9,Sql 2000,Vb6)

    Does it produce an error or just not do anything at all?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    313

    Re: connect to server at run time(CR9,Sql 2000,Vb6)

    Quote Originally Posted by Hack
    Does it produce an error or just not do anything at all?
    Thanks, Hack.
    No error, and do nothing.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    313

    Re: connect to server at run time(CR9,Sql 2000,Vb6)

    Quote 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
  •  



Click Here to Expand Forum to Full Width