
Seagate Crystal Report Designer Component
HI!
Why does Crystal Reports loose the connection while using the ADO and OLE DB
Connection String. In VB the connection is activated. I see the fields in
CR, but the connection ever terminated.
System:
Win NT 4.0 SP6
VB 6 SP 5
SQL 2000 with SQL Server and Windows authenfication
Here my example
Dim Report As New CrystalReport2
Dim rs1 As ADODB.Recordset
Dim con1 As New ADODB.Connection
con1.ConnectionTimeout = 15
con1.Provider = "sqloledb"
con1.Properties("Data Source").Value = ServerName
con1.Properties("Initial Catalog").Value = DatabaseName
con1.CursorLocation = adUseClient
If optWinNTAuth = True Then
con1.Properties("Integrated Security").Value = "SSPI"
Else
UserName = "BOHLEN "
Password = "xxxx"
con1.Properties("User ID").Value = UserName
con1.Properties("Password").Value = Password
End If
con1.Open
Set rs1 = New Recordset
Set rs1.ActiveConnection = con1
rs1.CursorType = adOpenKeyset
rs1.LockType = adLockOptimistic
rs1.Open "SELECT QUARTAL,LOCATION,HAFEN FROM OAQUART_DRUCK ORDER BY
QUARTAL, LOCATION", , , , adCmdText
Me.MousePointer = vbDefault
Report.Database.SetDataSource rs1
'EVERYTHING ALLRIGHT UNTIL THIS POINT
'In rs1 i can see the data
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
While CRViewer1.IsBusy
DoEvents
Wend
'The Viewer tells me following error:
This field name is not known: Sure, the Connectionstring is far away from
me..
Thorsten E. Bohlen