dbTalk Databases Forums  

Missing reference

comp.databases.ms-access comp.databases.ms-access


Discuss Missing reference in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Devenish
 
Posts: n/a

Default Missing reference - 11-30-2010 , 01:51 PM






I have installed a program called PdfCreator to use alongside an
Access2K program. I include a Reference to it (the program resides in
C:\Program Files\PdfCreator\PdfCreator.exe)

Everything works fine.

I transfer the Access program to a client's machine that has
PdfCreator installed in the same place but I get a Missing reference.
This shows in the References popup with the correct pathname shown at
the bottom of the window. I uncheck this missing reference. Close
the References window. Open it again and scroll down to PdfCreator
(still shown with correct pathname) and everything is OK once more.

Why does it not find it the first time?

Is there something else I should do?

I thought I may need to register it and found that I should run:
C:\Program Files\PdfCreator\PdfCreator.exe /REGSERVER
However this does not help.

Any suggestions?

Reply With Quote
  #2  
Old   
John Spencer
 
Posts: n/a

Default Re: Missing reference - 11-30-2010 , 02:24 PM






Are the versions the same? That can cause a problem.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 11/30/2010 2:51 PM, Jim Devenish wrote:
Quote:
I have installed a program called PdfCreator to use alongside an
Access2K program. I include a Reference to it (the program resides in
C:\Program Files\PdfCreator\PdfCreator.exe)

Everything works fine.

I transfer the Access program to a client's machine that has
PdfCreator installed in the same place but I get a Missing reference.
This shows in the References popup with the correct pathname shown at
the bottom of the window. I uncheck this missing reference. Close
the References window. Open it again and scroll down to PdfCreator
(still shown with correct pathname) and everything is OK once more.

Why does it not find it the first time?

Is there something else I should do?

I thought I may need to register it and found that I should run:
C:\Program Files\PdfCreator\PdfCreator.exe /REGSERVER
However this does not help.

Any suggestions?

Reply With Quote
  #3  
Old   
Jim Devenish
 
Posts: n/a

Default Re: Missing reference - 11-30-2010 , 03:08 PM



On Nov 30, 8:24*pm, John Spencer <JSPEN... (AT) Hilltop (DOT) umbc> wrote:
Quote:
Are the versions the same? *That can cause a problem.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 11/30/2010 2:51 PM, Jim Devenish wrote:



I have installed a program called PdfCreator to use alongside an
Access2K program. *I include a Reference to it (the program resides in
C:\Program Files\PdfCreator\PdfCreator.exe)

Everything works fine.

I transfer the Access program to a client's machine that has
PdfCreator installed in the same place but I get a Missing reference.
This shows in the References popup with the correct pathname shown at
the bottom of the window. *I uncheck this missing reference. *Close
the References window. *Open it again and scroll down to PdfCreator
(still shown with correct pathname) and everything is OK once more.

Why does it not find it the first time?

Is there something else I should do?

I thought I may need to register it and found that I should run:
C:\Program Files\PdfCreator\PdfCreator.exe /REGSERVER
However this does not help.

Any suggestions?
Both machines are running Access 2000 on Windows XP

Reply With Quote
  #4  
Old   
Tony Toews
 
Posts: n/a

Default Re: Missing reference - 11-30-2010 , 05:53 PM



On Tue, 30 Nov 2010 11:51:12 -0800 (PST), Jim Devenish
<internet.shopping (AT) foobox (DOT) com> wrote:

Quote:
I have installed a program called PdfCreator to use alongside an
Access2K program. I include a Reference to it (the program resides in
C:\Program Files\PdfCreator\PdfCreator.exe)
Which PDF Creator? There appear to be two versions. One is a free
open source system. The other a closed source commerical program.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #5  
Old   
Hans Up
 
Posts: n/a

Default Re: Missing reference - 11-30-2010 , 06:00 PM



Jim Devenish wrote:
Quote:
On Nov 30, 8:24 pm, John Spencer <JSPEN... (AT) Hilltop (DOT) umbc> wrote:
Are the versions the same? That can cause a problem.

Both machines are running Access 2000 on Windows XP
Are the versions of PDFCreator the same on both machines?

Version 1.1.0 was released on 11/21/2010. Perhaps one machine has the
latest version, and the other has an earlier version.

Reply With Quote
  #6  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Missing reference - 11-30-2010 , 07:46 PM



Jim Devenish <internet.shopping (AT) foobox (DOT) com> wrote in
news:97988796-4806-4246-a296-f5185fc1ca78 (AT) 35g2000prt (DOT) googlegroups.com
:

Quote:
I have installed a program called PdfCreator to use alongside an
Access2K program. I include a Reference to it (the program
resides in C:\Program Files\PdfCreator\PdfCreator.exe)
I'm using PDFCreator with two of my clients' apps, and no reference
is required at all.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #7  
Old   
Jim Devenish
 
Posts: n/a

Default Re: Missing reference - 12-01-2010 , 08:14 AM



On Dec 1, 1:46*am, "David-W-Fenton" <dfas... (AT) dfenton (DOT) com> wrote:
Quote:
Jim Devenish <internet.shopp... (AT) foobox (DOT) com> wrote innews:97988796-4806-4246-a296-f5185fc1ca78 (AT) 35g2000prt (DOT) googlegroups.com
:

I have installed a program called PdfCreator to use alongside an
Access2K program. *I include a Reference to it (the program
resides in C:\Program Files\PdfCreator\PdfCreator.exe)

I'm using PDFCreator with two of my clients' apps, and no reference
is required at all.

--
David W. Fenton * * * * * * * * *http://www.dfenton.com/
contact via website only * *http://www.dfenton.com/DFA/
I am using the free version from SourceForge.

I did find that I did have different versions of PdfCreator: 0.9.0.9
on mine and 0.9.0.5 on the client's. Now that I have updated both to
1.1.0, the problem has gone away. Thanks.

I am interested in David's comment that he needs no reference. My
code is:

Public Function producePDF(sourceDocument, destinationFolder,
destinationFilename) As Boolean
' to create a pdf form of the quote, saved in the same directory
On Error GoTo errorCode
DoCmd.Hourglass True
producePDF = True '
assume everything will be OK
Dim thePDFCreator As Object
Set thePDFCreator = New clsPDFCreator
With thePDFCreator
.cStart "/NoProcessingAtStartup"
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = destinationFolder
.cOption("AutosaveFilename") = destinationFilename
.cOption("AutosaveFormat") = 0 ' 0 =
PDF

Dim theDefaultPrinter As String
theDefaultPrinter = .cDefaultPrinter ' note
the default printer
.cDefaultPrinter = "PDFCreator"

.cClearCache
.cPrintFile sourceDocument

.cPrinterStop = False
End With

Dim aStep
aStep = 0 ' wait
for the output file to be created
Do While (thePDFCreator.cOutputFilename = "") And (aStep <
(maxTime * 1000 / sleepTime))
aStep = aStep + 1
Sleep 200
Loop

Dim theOutputFilename As String
theOutputFilename = thePDFCreator.cOutputFilename '
remember it for later

With thePDFCreator
.cDefaultPrinter = theDefaultPrinter ' re-
establish the default printer
Sleep 200
.cClose
End With

Sleep 2000 ' Wait
until PDFCreator is removed from memory

If theOutputFilename = "" Then
producePDF = False
End If

exitCode:
DoCmd.Hourglass False
Exit Function
errorCode:
producePDF = False
MsgBox Err.Description, , "Error (producePDF) " & Err.Number
Resume exitCode
End Function

Without setting a reference I get a compile error on the line:

Set thePDFCreator = New clsPDFCreator

How do I get around this David? Or do you use a different approach?

Reply With Quote
  #8  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Missing reference - 12-01-2010 , 03:52 PM



Jim Devenish <internet.shopping (AT) foobox (DOT) com> wrote in
news:65ab901a-8864-4a7e-b632-ba0c89f60e63 (AT) a28g2000prb (DOT) googlegroups.co
m:

Quote:
Without setting a reference I get a compile error on the line:

Set thePDFCreator = New clsPDFCreator

How do I get around this David? Or do you use a different
approach?
Use late binding and replace that with this:

Set thePDFCreator = CreateObject("PDFCreator.clsPDFCreator")

I never use references for anything but the base 3 that Access
requires.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #9  
Old   
Clif McIrvin
 
Posts: n/a

Default Re: Missing reference - 12-03-2010 , 08:04 AM



"Jim Devenish" <internet.shopping (AT) foobox (DOT) com> wrote


Without setting a reference I get a compile error on the line:

Set thePDFCreator = New clsPDFCreator

How do I get around this David? Or do you use a different approach?

****

I was waiting for another reply ....

my guess is that David is using CreateObject() insatead of New ...
you'll have to research how to use CreateObject. Look up references to
"late binding". If this isn't enough to get you going, I can dig a bit
to find some url's for you.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)

Reply With Quote
  #10  
Old   
Clif McIrvin
 
Posts: n/a

Default Re: Missing reference - 12-03-2010 , 06:09 PM



"Clif McIrvin" <clare.nomail (AT) gmail (DOT) com> wrote

Quote:
my guess is that David is using CreateObject() insatead of New ...
you'll have to research how to use CreateObject. Look up references
to "late binding". If this isn't enough to get you going, I can dig a
bit to find some url's for you.

***
Quote:
Is there a difference between the following? Dim RE as RegExp Set RE =
New RegExp and Dim RE as Object Set RE =
CreateObject("VBScript.Regexp")
Sure. The first one is called "early binding". It requires that you set
a reference first, before using it. The advantage is that you'll get
IntelliSense. A drawback is that you must have this special reference on
all computers. So "early binding" gives you type safety as the type is
known at compile time.
The later is called "late binding". You don't need a reference. The type
is resolved at runtime and it matches different versions. Late binding
resolves automatically against the "current" installed version. The only
caveat is only to use methods which all possible versions have in
common.
While developing I'm using early binding which is later removed. So the
code looks often like this:
Dim app As Object ' Excel.Application
Set app = CreateObject("Excel.Application") ' new Excel.Application()
The only drawback is, that I'm using named constants which I have to
redeclare after dropping the libraries reference.
mfG
--> stefan <--
[ Taken from the thread at
<http://groups.google.com/group/microsoft.public.access/browse_thread/thread/2793478acd6ffe0b/>
]

---------

Early binding is fine for writing and debugging VBA automation code,
because it gives you Intellisence. However, it also requires a checked
reference to a version specific object library. After your code is
working the way you want it to, try converting it to use late binding,
and deselect the checked reference to the Excel Object library. I have a
sample that uses late binding that you can download:
Automation with Late Binding (Calling Excel's NormInv function)
http://www.accessmvp.com/TWickerath/...Statistics.zip
This particular sample is designed to keep a global object variable open
whenever the database is open, so you should see the same behavior that
you reported, ie. an instance of Excel.exe in Task Manager until you
close the
Access app. However, it would have been just as easy to include code to
Quit and set the object variable = Nothing when the form was closed. I
just didn't implement such a method.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/

[ Later in the same thread is a reference to an article by Michael
Kaplan explaining why you want to use late binding. ]
INFO: How to guarantee that references will work in your applications
http://trigeminal.com/usenet/usenet026.asp?1033 (The title is
misleading. <smile>)
Quote:
although to be honest I get a bit nervous about implementing using
methods (late binding in this case) I am not that familiar with in case
I screw it up
Late binding requires changing about three lines of code usually
although maybe a few more if you are using some Excel constants.
These lines of code are usually just the Dim statements so it's
relatively painless and easily tested.
And it works!
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

[ Taken from the thread at
<http://groups.google.com/group/microsoft.public.access/browse_thread/thread/6ff8d9dcdfa8b290/>
]


--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.