473,725 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving PDF file as an OLE object in a database

74 New Member
I have been trying to figure this out for some time now.

Currently i have a code that changes the default printer to a PDF printer, it then takes the name of a field in my form and changes the name of a report to that field then prints, i get the PDF file so i can email out BUT i want to save that PDF file as an Ole object on one of my tabels for later referance but i dont know how to go about this.

thanks in advance for your help.
Apr 9 '07 #1
14 19475
Denburt
1,356 Recognized Expert Top Contributor
I have mentioned this in several articles recently and thought I would let you know that if you are storing OLE objects in a field in your table you could be asking for serious trouble. MS Access has a 2 gig limit so if you take this approach then keep this in mind, OLE objects tend to increase the size of your DB in a major way. I did find the following thread this thread has a link which should guide you in the direction you want.

http://www.thescripts.com/forum/thread205446.html
Apr 9 '07 #2
Hutch
74 New Member
how would i go about saving these "PDF" files in a seperate folder on the server then creating a link between a field in my table to that particular file inside the folder?
Apr 10 '07 #3
pks00
280 Recognized Expert Contributor
How many pdf's are you likely to store. I dont see a problem too much so as long as its not too many. But I dont store as ole objects, instead I store them as blobs.
One app of mine has a few wave files used when certain thresholds are hit. The way I store this is in a table in Access as blobs. I then use code to read and save onto the user's PC

If shedloads then u should as already suggested, store a path to the file.

Where are you storing these pdf's?
What u need to do is each time u create a pdf, store that name in some table
eg
tblPDFs
ID (autonumber)
Name (name of pdf)

assume pdf's are all in one directory, if not then u need to store the path as well

now in your other table, u can store the ID. That is the link to the pdf
Apr 10 '07 #4
Hutch
74 New Member
I use a form to pull several different types of information from several tables and then record that information onto another table to creat a "quote" i then print it as a PDF i have about 2000 PDF's right now. and currently i have to go out onto the server through folder to find the PDF quote to email out, i want a field in my "QUOTE" table that links the PDF to a command button that will bring it up. i have it all figured out but the actuall link. i dont know how to set that value.
Apr 10 '07 #5
Denburt
1,356 Recognized Expert Top Contributor
I have been trying to figure this out for some time now.

Currently i have a code that changes the default printer to a PDF printer, it then takes the name of a field in my form and changes the name of a report to that field then prints, i get the PDF file so i can email out BUT i want to save that PDF file as an Ole object on one of my tabels for later referance but i dont know how to go about this.

thanks in advance for your help.
Can we see some of this code? Does the code specify where to put the PDF's? Do the PDF's print to some random location each time? You should be able to tell the PDF's where to print to, and once you do that then you can just store the path and off ya go.

I have a contract database that stores PDF's as hyperlinks so they can click on it and actually see the contract. My version uses a dialog box to locate the contracts then store the path.
Apr 11 '07 #6
Hutch
74 New Member
Set Application.Pri nter = Application.Pri nters("Quote - PDF")

this is the code to get the printer to switch over, the printer is specified to print to a certain folder on the server. another funny thing is all the files get printed in black and white even through all the settings on the printer are correct, althoguh i'm not stressing over this part i thought you might be able to shed some light on the subject. thanks
Apr 12 '07 #7
Denburt
1,356 Recognized Expert Top Contributor
the printer is specified to print to a certain folder on the server
Since you know the path, and you probably know the file name simply store that info in a hyperlink field and off you go.

Me!SomeHyperFie ld = "\\ServerName\F older\FileName. pdf

I will see if I can find anything on the black and white issue.
Apr 12 '07 #8
Hutch
74 New Member
Since you know the path, and you probably know the file name simply store that info in a hyperlink field and off you go.

Me!SomeHyperFie ld = "\\ServerName\F older\FileName. pdf

I will see if I can find anything on the black and white issue.

should i take it the "somehyperfield " is the name of the field on my table
Apr 12 '07 #9
Denburt
1,356 Recognized Expert Top Contributor
Yes sir once you set it as a Hyperlink field in your table then set the path/filename they can click on it and it will open the pdf so they can view it.
Apr 12 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
10139
by: simon place | last post by:
is the code below meant to produce rubbish?, i had expected an exception. f=file('readme.txt','w') f.write(' ') f.read() ( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) on win32. ) I got this while experimenting, trying to figure out the file objects modes,
1
1506
by: Matthew Wilson | last post by:
I have a bunch of classes that track data for time series. The classes are really just glorified dicts where the key is a date object, and the value is the value as of that date. I want a way to store a bunch of these tseries objects into a file object. I want to be able to open the file object, iterate through all timeseries, then create some new tseries, and add them to the file object. I also want to be able to delete tseries from...
2
2163
by: Duy Nguyen | last post by:
how can I save an image file to database?
7
12582
by: mfozdar_mca | last post by:
Dear sir I m Software Engineer in Software co. My question is how do i Store OLE Object (JPG) file to database AppendChunk plz Help me
0
1420
by: lipsa | last post by:
i want 2 write arnd 2 lakh rows of data(16 columns)data in a pipe separated text file from database(sql server) .(its the need ,cant help) i m using recordset/file system object. its taking a lotssss of time. plz suggest me some affective way 2 do it faster... regards, Lipsa(plz ASAP)
9
5833
by: sc_wizard29 | last post by:
Hi everyone, Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in file: ...
9
3008
by: TC | last post by:
Like a lot of database developers, I often choose Jet for the back- end. I'm starting to worry about what will happen when Jet is deprecated. Ostensibly, Jet users like me must switch to SQL Server (or MSDE / SQL Express), but there's something I just don't understand. Without Jet, how will we create file server database applications? In other words, how will we create multi-user apps which use a file server to share data and don't...
2
1107
by: Thomas Ploch | last post by:
Hello folks, I am currently developing an open source Event Managment software (events in real-life, like concerts, exhibitions etc. :-) ) using wx for the GUI, and I need an Object database. Since this is the first time I actually need doing this, I wondered if anybody here could recommend one. It can be fairly simple. It doesn't need threading support and will only host one client (the application, but I am thinking about making this...
3
1096
by: tshad | last post by:
I have a file that I want to upload periodically from a users machine if they come back later. I am storing the filename and path in my database. But the HtmlInputFile normally file is set to read-only. For example, if I have the object: <input id="MyResumeFile" style="width:300px" type="File" runat="Server">
5
6430
by: JohnLorac | last post by:
Hello, can somebody help me with saving file into local disk using javascript? I made some sample code which unfortunately won't work :(. Applet sample file: public class IO extends Applet {
0
8886
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8750
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9255
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9104
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6010
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.