cancel
Showing results for 
Search instead for 
Did you mean: 

CRAXDRT Error Occured on Server. -2147189176 : Logon failed.

Former Member
0 Kudos

Hi

I am trying out Crystal Reports XI sample application with JavaPluginViewer.asp to view crystal reports from ASP pages.

Applet loads succesfully but i am getting this error message on each report refresh

CRAXDRT Error Occured on Server. -2147189176 : Logon failed.
Details:  [Database Vendor Code: 1005 ]

Which is pretty self-explanatory, report fails to login to defined DB, at this case Oracle 9.

But in crystal XI ide the same report on the same machine succeeds in connecting and loging into DB.

Where is the catch ?

thx

Edited by: Daniel Polonsky on Mar 12, 2009 8:37 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Is there some place i should specify DB login credentials ?

I have seen some examples on web like:

...
<%
'            Logon to DataSources
set mainReportTableCollection = session("oRpt").Database.Tables

For each mnTable in mainReportTableCollection
    with mnTable.connectionproperties
        .Item("User ID") = "User"
        .Item("Password") = "Password"
        .Item("DSN") = "DSN"
        .Item("Database") ="DB1"
    end With
Next
%>
...

or

Set CRXTables = CRXReport.Database.Tables
 Set CRXTable = CRXTables.Item(1)
 CRXTable.SetLogonInfo u201CXtreme Sample Databaseu201D,u201DXtremeu201D,u201DAdminu201D,u201Du201D

none of them work for me yet, but it sounds like a promising lead

Former Member
0 Kudos

after setting DB login credentials it started to work

UserID = u201CYour database userID goes hereu201D

Password=u201DYour database password goes hereu201D

Set crtable = session(u201CoRptu201D).Database.Tables.Item(1)

Crtable.SetLogonInfo u201CDSN_Nameu201D, u201CDatabase_Nameu201D, cstr(UserID), cstr(Password)

What i don't understand is why in application sample DB login credentials are not set ?!

former_member183750
Active Contributor
0 Kudos

.SetLogonInfo is a deprecated method an I would not recommend you use it. use the connection properties bag instead. Your code would be:

report.database.tables(1).connectionProperties.item("DSN") = "the DSN"

report.database.tables(1).connectionProperties.item("User ID") = "the user ID"

report.database.tables(1).connectionProperties.item("Database ") = "the database name"

report.database.tables(1).connectionProperties.item("Password") = "the password"

Ludek

Former Member
0 Kudos

Thanks for your reply

I am getting the following error when using your suggestion

"Error Occurred Reading Records: Subscript out of range"

former_member183750
Active Contributor
0 Kudos

Try this then:

report.database.tables(1).connectionProperties("DSN") = "the DSN"

report.database.tables(1).connectionProperties("User ID") = "the user ID"

report.database.tables(1).connectionProperties("Database ") = "the database name"

report.database.tables(1).connectionProperties("Password") = "the password"

Ludek

Former Member
0 Kudos

same results

by the way if i am marking DNS and Database assignments i don't get error (of course i can't connect to databse without the other parameters, but these 2 parameters seem to be problematic ones )

former_member183750
Active Contributor
0 Kudos

Try a new report, one table, one field. No subreports. Make sure you are going through ODBC. Make sure the report works in the CR designer. In your code all you need to do as far as DB logon is concerned is:

report.database.tables(1).connectionProperties("Password") = "the password"

The report "remembers" all other info.

Ludek

Former Member
0 Kudos

Actually i am using stored procedure in my report and not tables, does it mean i should assign credentials differently ?

former_member183750
Active Contributor
0 Kudos

no. use the SP instead.

Ludek

Former Member
0 Kudos

do you mean replace tables with storedprocedures?

report.database.storedprocedures(1).connectionProperties("DSN") = "the DSN"

report.database.storedprocedures(1).connectionProperties("User ID") = "the user ID"

report.database.storedprocedures(1).connectionProperties("Database ") = "the database name"

report.database.storedprocedures(1).connectionProperties("Password") = "the password"

former_member183750
Active Contributor
0 Kudos

well, you can create the new report off of the stored proc, or any table you want. I'm just trying to see if we can connect at all.

Ludek

Former Member
0 Kudos

I am getting connected to DB using the old deprecated way of connection.


UserID = u201CYour database userID goes hereu201D
Password=u201DYour database password goes hereu201D
Set crtable = session(u201CoRptu201D).Database.Tables.Item(1)
Crtable.SetLogonInfo u201CDSN_Nameu201D, u201CDatabase_Nameu201D, cstr(UserID), cstr(Password)

But for some reason i am getting errors when connecting in a new way (you have suggested).

maybe i have some left overs of previous crystal version and it messes things up.

if i do how can i make sure that previous version left overs (if any) are not accessed ?

former_member183750
Active Contributor
0 Kudos

I have sever doubts that a previous version of CR is getting in the way. But you can check that by using the Modules utility available from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip

Also, seeing as you are using this in classic ASP, see if you can post the query to the Java Development - Crystal Reports forum as they deal with the RDC in ASP on a more regular basis.

Ludek

Answers (0)