|
-
Apr 11th, 2008, 08:57 PM
#1
Thread Starter
New Member
VS 2005 VB - 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 myReportForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
ChildFormAutoSizeFit(Me)
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, "myDatabase.mdb", "", "myPassword")
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
AxCRViewer1.ViewReport()
Catch ex As Exception
MsgBox(ex.ToString())
Finally
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 = "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?...
Please????...
a lot of appreciation in advance....
Thanks....
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
|
Click Here to Expand Forum to Full Width
|