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

Comments

Popular posts from this blog

How to Make Windows Photo Viewer Your Default Image Viewer on Windows 10

How to configure your Outlook GMail account

B1SiteUser Password Reset and Recovery