Click to See Complete Forum and Search --> : How to connect to MS SQL


Dean_Reedy
August 26th, 2004, 03:38 PM
I am switching from Crsytal Report 8s OCX to RDC viewer. I am calling reporting which were being called previously by ther OCX's my problem is connecting to my MS SQL Server 2000, I keep getting errors. How do I connect to MS SQL Server? My Code is below:


Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report


Private Sub Form_Load()
Set Appl = New CRAXDRT.Application
Set Report = New CRAXDRT.Report
Set Report = Appl.OpenReport("N:\FertSys05\Reports\230-Detail Inventory Audit Report.rpt")

Report.Database.LogOnServer "pdssql.dll", "Server Name", "Database", "login", "password"


CRViewer1.ReportSource = Report
CRViewer1.ViewReport

End Sub


When I do the code above I get an error:
0x0aced480" reference memory at 0x00000044. The memory could not be "read"
Any ideas would be great.

thanks,


Dean