Visual Basic 6 Runtime Error 20599 Cannot Open SQL Server



Dim strReport As String

MyCmd.CommandText = "Select * from tablename "

strReport = App.Path & "\foldername\Report.rpt"

CrystalReport1.Connect = "Provider=MSDASQL.1; Persist Security Info=False; Data Source=DSNname; uid=username; pwd=password;"

CrystalReport1.ReportFileName = App.Path & "\foldername\Report.rpt"

CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles
CrystalReport1.ReportSource = 0

CrystalReport1.WindowState = crptMaximized
CrystalReport1.Action = 1

Post a Comment

1 Comments