Run-time Error 91
From: TomKCrmGuy (tomkcrmguy_at_discussions.microsoft.com)
Date: 12/30/04
- Next message: PJ: "Re: Unwanted time showing up in date fields"
- Previous message: laurenh: "Unwanted time showing up in date fields"
- Next in thread: TomKCrmGuy: "RE: Run-time Error 91"
- Reply: TomKCrmGuy: "RE: Run-time Error 91"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Dec 2004 15:29:04 -0800
I have a VB6 application that connects to a SQL Server database, and displays
a crystal report for selected data. The application works fine when logged
into the computer using an account with Administrative privileges. The
application was installed using the Wise Installer. When I log into the
computer using an account with user privileges, the application displays the
following error message:
Run-Time error 91
Object variable or with block variable not set.
The application closes after I acknowledge the error.
The client PC is Windows XP.
The application is written in VB6. I am using Crystal Reports 8.5 developer.
Here is a code snippet:
Private Sub Class_Initialize()
'Assign application object
Set Application = CreateObject("Crystal.CRPE.Application")
End Sub
Private Sub ShowReport(inFileName, inMode)
Dim strPreview As String
Set Report = Application.OpenReport(frmMain.App_Path & "\Reports\" &
inFileName)
Report.DiscardSavedData 'required for consistent results
'Log on to the ODBC connection
Application.LogOnServer "pdsodbc.dll", "MYConnection_DSN", , "sa", "sa"
'Selection formula
Report.RecordSelectionFormula = "{Company.USERFIELD1} = '" &
frmMain.txtNum1.Text & "'"
strPreview = "My Company report"
I have spent hours trying to find which registry key or directory permission
needs to be changed, with no success. I have tried to use RegMon, but you
need to be logged in as an administrator to use this.
Does anyone have any ideas?
-- Thanks in Advance, Tom Kaiser
- Next message: PJ: "Re: Unwanted time showing up in date fields"
- Previous message: laurenh: "Unwanted time showing up in date fields"
- Next in thread: TomKCrmGuy: "RE: Run-time Error 91"
- Reply: TomKCrmGuy: "RE: Run-time Error 91"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|