Skip to Content
author's profile photo Former Member
Former Member

VS 2005 VB - MS ACCESS 2007 - Crystal Report XI R2 "Error: Logon failed.." Please help!!

Is there anybody there have an idea to resolve this vb to crystalreport XI connection problem...

Im using VS2005 VB and MS ACCESS '07 and Crystal Report XI R2

Here's my code


Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load



Me.Cursor = Cursors.WaitCursor

Me.MdiParent = frmMain

crxApp = New CRAXDRT.Application

crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)

crxDataBase = crxReport.Database

crxTables = crxDataBase.Tables

For Each crxTable In crxTables

crxTable.Location = DataSource 'My .mdb source path

crxTable.SetLogOnInfo("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & crxDataBasePath, "dbEmployee.mdb", "", "00019136392852")

Next crxTable

'**** Note:

'When ever i used this recordSelectionFormula? it works properly

'and it get connected and show the report but then this

'recordSelectionFormula is something limited for filtering data thats

'why i need to use more flexible filter like CRXDRT.Report.SqlQueryString

'but then my problem is the login connection from the database is somewhat failed...


'this RecordSelectionFormula works

'crxReport.RecordSelectionFormula = strSelectionfrm

'this SQLQueryString failed.. why?? what's the different?

crxReport.SQLQueryString = strSqlQuery

AxCRViewer1.ReportSource = crxReport


Catch ex As Exception



Me.Cursor = Cursors.Default

End Try

End Sub


here's my "strSelectionfrm"


strSelectionfrm = "{CmpnyDetails.IDNo} like '*' and {tblCompanyDetails.Status} = 'REGULAR' and {Attendance.AFrom} in #" & Format(DatePickerFrom.Value, "MM/dd/yyyy") & "# to #" & Format(DatePickerTo.Value, "MM/dd/yyyy") & "#"


and here's my "strSqlQuery"


strfilter = strfilter = "Select * from CmpnyDetails as cd left outer join Attendance as att on att.IDNo = cd.IDNo where (att.AFrom Between #" & Format(DatePickerFrom.Value, "MM/dd/yyyy")

& "# and #" & Format(DatePickerTo.Value, "MM/dd/yyyy") & "#) and cd.[Status] = 'REGULAR' and cd.IDNo like '*'"


Please anybody can help or any idea with this?...


a lot of appreciation in advance....


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Apr 11, 2008 at 08:22 PM

    Moved to Crystal Reports RDC.

    You are using RDC, not CR.NET so I have moved it to the COM forum.

    Good luck.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.