Results 1 to 4 of 4

Thread: Changing SQL Database @ Runtime [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member Harvester's Avatar
    Join Date
    May 2002
    Location
    God's Country
    Posts
    124

    Changing SQL Database @ Runtime [RESOLVED]

    I am sure this is somewhere in the forums but I can't find a definitive answer. I have an app that is using the Crystal Report Viewer to display some reports. I'm hitting a SQL server 2000 Database. My problem is getting these reports to run on a database with a different name.

    I sent my App to a friend of mine and the reports won't run. I set up my instance of SQL Server with an Alias and he didn't set his up that way. Also, our databases are named differently. The reports run perfectly on my machine but when he tried to run them he gets "Server has not yet been opened."


    I have looked at the knowlege base at Crystal Decisions and have tried some of their suggestions with the reports.

    Here's a snippet of my current code.

    VB Code:
    1. If crApp Is Nothing Then
    2.         Set crApp = New CRAXDRT.Application
    3.        
    4.         Call crApp.LogOnServerEx("p2ssql.dll", DBConn.Server & IIf(LenB(Trim$(DBConn.Alias)) > 0, "\" & DBConn.Alias, ""), _
    5.         DBConn.DatabaseName, DBConn.UserName, DBConn.UserPass, Chr(34) & CStr(CRDatabaseType.crSQLDatabase) & Chr(34), DBConn.ConnString)
    6.     End If
    7.  
    8.     Load rptForm
    9.  
    10.     Set rpt = crApp.OpenReport(rptPath)

    I thought that the LogOnServer and LogonServerEx were supposed to be the way to change data sources. Any help is appreciated. Thanks.
    Last edited by Harvester; Jan 13th, 2003 at 03:12 PM.

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