以下代码出现server has not yet been opened的错误,请指点
Dim Report As New CrystalReport1
Dim conn As Connection
'Dim rst As ADODB.Recordset
Dim comm As ADODB.CommandPrivate Sub Form_Load()
Screen.MousePointer = vbHourglassSet conn = New ADODB.Connection
conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;UID=sa;pwd=nylyj;Initial Catalog=school;Data Source=nylyj"Set comm = New ADODB.Command
Set comm.ActiveConnection = conncomm.CommandText = "select * from score"
comm.CommandType = adCmdText
Report.Database.AddADOCommand conn, comm
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefaultEnd SubPrivate Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidthEnd Sub