on 03-11-2009 4:53 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?!
.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
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
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
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"
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 ?
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
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.