HELP ME HELP ME HELP ME! VB & Crystal Reports
The error I'm getting is a Crystal Reports error: OraOLEDB, ORA-01005: null password given: logon denied. then the next message is: Server not yet opened.
I'm using the RDC for VB. I went through the report wizard in VB and configered it to use the Active Driver(ADO). I then entered in my sql select statment and finished configuring the report with no problem. The RDC also created a form with the CRViewer.
Here is my code for the CRViewer form(PastDueActivities)
################################################## ########
Dim Report As New PastDueActivities
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
AddDataConnection 'calls the sub
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Private Sub AddDataConnection()
On Error GoTo err_handle
Dim strConnect As String
Dim objConn As ADODB.Connection
Dim cm_fields As ADODB.Command
Dim sSQL, Msg As String
Err.Clear
strConnect = "Provider=OraOLEDB.Oracle.1;Password=masterkey;Per sist Security Info=True;User ID=sysdba;Data Source=slxp.bma.com"
sSQL = "SELECT A1.ACCOUNT, C1.LASTNAME, C1.FIRSTNAME, C1.WORKPHONE, A2.CITY, A2.STATE, A3.STARTDATE, A3.DESCRIPTION, A3.CREATEDATE, U1.USERNAME " & _
"FROM ACCOUNT A1,CONTACT C1, ADDRESS A2, ACTIVITY A3, USERINFO U1 WHERE A1.ACCOUNTID = C1.ACCOUNTID AND C1.ADDRESSID = A2.ADDRESSID AND " & _
"C1.CONTACTID = A3.CONTACTID AND A3.CREATEUSER = U1.USERID"
Set objConn = New ADODB.Connection
objConn.Open strConnect
Set cm_fields = New ADODB.Command
cm_fields.ActiveConnection = objConn
cm_fields.CommandText = sSQL
cm_fields.CommandType = adCmdText
Report.Database.AddADOCommand objConn, cm_fields
Report.PaperSize = crPaperA4Small
Exit Sub
err_handle:
If Err.Number <> 0 Then
Msg = "Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Err.Description
MsgBox Msg, vbCritical, "SLXREPORT ERROR@@@@"
End If
End Sub
################################################## ##########
I don't under stand why I'm getting this error. I then went through the report wizard I created the connection string on the fly and it connected. I also have the connection string defined in the AddDataConnection sub for ADO.
another question: When using ADO for the RDC am I supposed to define the select statement again?
Please give me any help you can. I've been working on this project for 3 days now...ARRRRRRRRGGGGGG :)
using CRW Developer 8.5 and VB 6 sp5