Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 3rd, 2005, 05:13 AM
Registered User
 
Join Date: Mar 2005
Location: , , Philippines.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logon Failed!

Hi!

Please check out my code. I get this error when I 'CRViewer.ViewReport' is called.

Logon failed.
Details: ADO Error Code: 0x80030020
Source: MS OLE DB Service Components
Description: A share violation has occured

The code is pretty simple and basic. Is there anything missing or something I didn't declare?

Thanks a lot!

-----------------------------------------------------------------

    Dim crxApp As New CRAXDRT.Application
    Dim crxRep As CRAXDRT.Report
    Dim crxDBTable As CRAXDRT.DatabaseTable
    Dim crxDB As CRAXDRT.Database
    Dim crxConn As CRAXDRT.ConnectionProperty

    On Error GoTo ERROR_HANDLER

    DoEvents
    Screen.MousePointer = vbHourglass

    Do
        DoEvents

        If CBox.GetPrinterJobs(TReport.DeviceName) <= 2 Then
            Exit Do
        End If
    Loop

    Select Case UCase(TReport.reportName)
    Case "PASTDUE_SCHEDULE"
        strFilename = "PDOSchedule"

    Case "PASTDUE_CURRENT"
        strFilename = "PDOCurrent"

    Case "PASTDUE_30DAYS"
        strFilename = "PDO30Days"

    Case "PASTDUE_ACTIVE"
        strFilename = "PDOActive"

    Case "PASTDUE_SUSPENDED"
        strFilename = "PDOSuspended"

    Case "PASTDUE_CANCELLED"
        strFilename = "PDOCancelled"

    Case "PASTDUE_ABC"
        strFilename = "PDOABCEmployees"

    End Select

    ' Open crystal report printjob and get number of parameters
    strFilename = UCase(App.Path & "\Reports\" & strFilename & ".rpt")
    strMessage = TPastDue.Message

    ' Open the report
    Set crxRep = crxApp.OpenReport(strFilename)

    ' Set database location
    Set crxDBTable = crxRep.Database.Tables(1)
    crxDBTable.Location = CBox.IniFileRead("Database", "Name")

    ' Pass parameters to report
    With crxRep.ParameterFields
        For i = 1 To .Count
            For j = 0 To .Count - 1
                If Trim(UCase(.Item(i).parameterFieldName)) = Trim(UCase(TReport.Parameters(j, 0))) Then
                    .Item(i).AddCurrentValue TReport.Parameters(j, 1)
                    Exit For
                End If
            Next
        Next
    End With

    ' Set printer settings
    With TReport
        crxRep.SelectPrinter .DriverName, .DeviceName, .Port
    End With

    ' Set selection formula
    If TReport.Filter <> "" Then
        crxRep.RecordSelectionFormula = TReport.Filter
    End If

    Screen.MousePointer = vbDefault

    With frmReportPreview.CRViewer
        .ReportSource = crxRep
        .ViewReport
    End With


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
logon failed serdarbyktmz Crystal Reports 0 April 18th, 2007 10:22 AM
LogOnException: Logon failed leoluvis Crystal Reports 0 February 7th, 2006 05:31 AM
logon failed Rohit Ranjan Crystal Reports 1 February 28th, 2005 06:19 PM
LOGON FAILED! winnie1778 Crystal Reports 1 January 25th, 2005 04:28 AM
Logon failed. msrnivas .NET Web Services 3 January 24th, 2005 02:56 PM



All times are GMT -4. The time now is 10:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.