Click to See Complete Forum and Search --> : Incorrect log on parameters error on some machines.


HairyMonkeyMan
March 18th, 2008, 10:24 AM
Hi Gurus,

I would be really greatfull if anyone could help me out with this problem. I'll include as much information as I can.

In our deployed application (wrote in vb.net using vs2005), we have a lot of crystal reports set up. There are no problems with any other report. We have never seen this problem before, and I have exhausted every option I can think of to fix it.

Firstly, this is the error message:
http://www.nikiteforum.com/cr_error.gif

This is the function that binds data to the report
Public Function LoadServiceHistory(ByVal Registration As String) As rptServiceHistory
Dim oVehicle As New clsVehicle
oVehicle.Registration = Registration
'fill job history datatable if at least 1 line of job history found for the booking...
If oVehicle.ServiceHistoryMostRecentFirst.Count > 0 Then
' Get service history for car in this booking
Dim dtServiceHistory As dsVehicle.VehicleDataSet.VEHICLE_SERVICE_HISTORY_RECORDDataTable = _
oVehicle.ServiceHistoryMostRecentFirst(False)
' Get service details
Dim dtServiceDetails As New dsVehicle.VehicleDataSet.Vehicle_Service_history_detailsDataTable
For Each row As dsVehicle.VehicleDataSet.VEHICLE_SERVICE_HISTORY_RECORDRow In dtServiceHistory
Dim dtTempServiceDetails As dsVehicle.VehicleDataSet.Vehicle_Service_history_detailsDataTable = _
oVehicle.ServiceDetails(CType(row.Mileage, Integer), row.Invoice, row.JobNumber)
For Each detailsRow As dsVehicle.VehicleDataSet.Vehicle_Service_history_detailsRow In dtTempServiceDetails
detailsRow.Job_Number = row.JobNumber
dtServiceDetails.ImportRow(detailsRow)
Next
Next
Dim tReport As New rptServiceHistory
tReport.Subreports(0).SetDataSource(CType(dtServiceDetails, DataTable))
tReport.SetDataSource(CType(dtServiceHistory, DataTable))
If Trim(Registration) = "" Then
tReport.SetParameterValue("Registration", "Unregistered Vehicle")
Else
tReport.SetParameterValue("Registration", Registration)
End If
pLoaded = True
pReport = tReport
Return tReport
Else
pLoaded = False
Return New rptServiceHistory
End If
End Function

If anyone has a suggestion, I would be more than happy to hear it.

Best regards

HairyMonkeyMan
March 19th, 2008, 08:46 AM
If anyone has any idea..... please, I'm getting desperate!

HanneSThEGreaT
March 19th, 2008, 08:58 AM
First for me too!
This may help in handling / tracing the error.
http://msdn2.microsoft.com/en-us/library/aa288423(VS.71).aspx

HairyMonkeyMan
March 19th, 2008, 10:31 AM
Thanks Hannes :)

I'm going to delve into crystal error handling here... it is such a weird problem.. the reporting engine shouldn't be trying to log onto the database since I'm sending it a datatable already full of data.

HanneSThEGreaT
March 20th, 2008, 02:40 AM
Good luck! :thumb:
And please let us ( me ) know how it goes :)

HairyMonkeyMan
March 20th, 2008, 08:09 AM
:) :) :) ITS FIXED :) :) :)

I went into the database expert, deleted connections to my datatables.. created new connections (same ones) and now it works!

Crystal reports does seem to have a few quirks, but I'm not complaining - hopefully I won't have to look at any for a while.

Cheers for the help Hannes :wave:

Boya Moya Lacka