Results 1 to 5 of 5

Thread: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    71

    Talking I can't Solve crystal report runtime error 20599 Cannot Open SQL Server

    I am using VB6.0 and
    crystal reports 8.5
    and the code which i have written is as below

    **********************************************************
    GenerateDSN
    With MAIN.CR
    .Reset: MAIN.InitCrys
    .ReportFileName = App.Path & "\Reports\rptVanInv.rpt"
    .Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=philiprj"

    .SelectionFormula = "{qry_WeeklyInv.VanInvFK} = " & nsdLoading.BoundText

    .WindowTitle = "Van Inventory Report"

    .ParameterFields(0) = "prBussAddr;" & CurrBiz.BUSINESS_ADDRESS & ";True"
    .ParameterFields(1) = "prmBussContact;" & CurrBiz.BUSINESS_CONTACT_INFO & ";True"
    .ParameterFields(2) = "prmTitle;VAN INVENTORY REPORT;True"
    .ParameterFields(3) = "prmVanName;" & nsdLoading.getSelValueAt(3) & ";True"
    .ParameterFields(4) = "prmDate;" & nsdLoading.getSelValueAt(2) & ";True"

    .PageZoom 100
    .Action = 1
    End With
    RemoveDSN
    End If
    *********************************************************

    th error is
    run-time error 20599 Cannot open SQl Server

    Thanks

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    71

    Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server

    PLZ any one have a solution

  3. #3
    Lively Member
    Join Date
    Sep 2007
    Location
    Texas
    Posts
    98

    Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server

    Is your connection string correct?
    ie .Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=philiprj"

    Does the report work when you test it in Crystal Reports?
    Working in VB2005 and SQL2005

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2007
    Posts
    71

    Cool Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server

    Quote Originally Posted by SunshineBH
    Is your connection string correct?
    ie .Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=philiprj"

    Does the report work when you test it in Crystal Reports?
    yes its work

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server

    What are the contents of the DSN file.

    Comment out the line RemoveDSN and rerun the program. Does that make a difference?

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