|
-
December 3rd, 2001, 02:40 PM
#1
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
-
December 4th, 2001, 03:39 AM
#2
This looks like your connection to the Oracle database is being refused due to a bad login, or that the connecting user does not have the right permissions for what you're trying to do.
I expect your program is falling over on the objConn.Open strConnect line, which points to your connection string (strConnect) not being correct.
Have a look at the ADODB.Connection <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdproconnectionstring.asp" target="_blank">ConnectionString Property</a> to see how it should be formatted and to give you some hints on fixing it.
Other things to check:
- Can you connect to the database using the details (username/password) you have supplied in the connection string?
- Can you run that Query on the server and get some results?
- Does the user you are connecting as (sysdba) have permissions on the server to run the query?
HTH,
I'd rather die peacefully in my sleep like my Grandfather,
than screaming in terror like his passengers. Jim Harkins
<a href="http://www.Horrible.Demon.co.uk/" target="_blank">http://www.Horrible.Demon.co.uk/</a>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks