Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scan Documents in MS Access - Kodak OCX -How?

439 views
Skip to first unread message

SSC

unread,
Jan 16, 2000, 3:00:00 AM1/16/00
to
Hi,

I am a medical student and I use MS Access 97 to store information about
patients.

I have a scanner and I would like to put a button on a form . When I press
that button I would scan the image-document to some folder and keep it in MS
Access as a link.

I went to www.mvps.org/access/ and I have gone trough deja.com and Microsoft
Access KB. I learned how to show images as links in MS Access.

Article Q148463: How to Display Image in Form Without Storing It in Table

BUT I still need to learn the code to make the scanner insert the link in a
control. Everything should be done automatically. Press a button, scan the
image and insert the link in a specified control.

It seems that I have to use Kodak-Wang imaging OCX which comes with Windows
98. I feel that as I am not a developer it is difficult to learn how to use
Kodak OCX.

Other possibility would be to buy Paperbrigde or Kodak Pro OCX but I can not
afford its price and anyhow this is not a professional application.

Can anyone Please help me?

Mario Sam Caro .
s...@esoterica.pt


Turtle

unread,
Jan 16, 2000, 3:00:00 AM1/16/00
to
You can start any scanning software with a Shell function, and feed it
keystrokes with SendKeys to get it to perform the scan.

Since you are storing images outside the database, you will need to develop
your own algorithm to determine the name of the file where you will store
each successive scan.

HTH
- Turtle

SSC wrote in message <85ti2t$hqs$1...@duke.telepac.pt>...

Bill

unread,
Jan 17, 2000, 3:00:00 AM1/17/00
to
Try this site

http://www.eastmansoftware.com/products/ImagingPro/Infodev.htm

it has the info on the Kadak OCX.


SSC <s...@esoterica.pt> wrote in message news:85ti2t$hqs$1...@duke.telepac.pt...

Michael Logue

unread,
Jan 17, 2000, 3:00:00 AM1/17/00
to
I am working on something similar. As you have probably found out, there is
not a lot of information available concerning the IMGSCAN.OCX on the web.
You can find documentation for this ocx at the following site:

http://www.eastmansoftware.com/products/ImagingPro/Infodev.htm

I definately recommend that you download the help file and manual.

Some things I have found out while playing with this control:

First: This control has been tested on only a handfull of scanner TWAINS.
In my situation, we are using Ricoh IS430 document scanners, and the IMGSCAN
ocx only partially works. As far as I can tell so far, I cannot control a
lot of the fine tuning that the ocx is capable of - such as controlling
resolution, contrast, brightness, etc. However, what has worked is being
able to save scanned images to the directory you specify.

Second: If you have more than one TWAIN loaded onto your system, you will
need to select the correct one by opening up the "Imaging for Windows"
program by Kodak, which comes with Windows 98 (found under the [Accessories]
start menu), and select the scanner from there. There may be a way of
selecting the desired TWAIN from code, though I haven't found it yet.

Third: The IMGSCAN.ocx does not seem to accept long file names for your
images. You can specify that the images are saved using a "template",
though this is limited to four characters, with the other four being used by
the program to designate the page number - ie Page0001.tif or File0001.tif
etc. This is troublesome for me as I require long file names that follow
certain naming conventions.

What I have worked out is a somewhat simple routine that will open up the
scanner interface so that I can set the resolution, image type (Black/White
or Greyscale), and scan the document into a temprorary directory. Once all
of the pages have been scanned, I have a function that will rename the files
based on criteria in my database, and place them in the proper directory. I
basicly do this from a simple form with a related subform. Here's sort of
how I have it set up.

frmDocument (using tblDocument as data source)
Fields:
[ParentID] - used to link to Master Table [tblMaster]
[DocumentNumber] - uses a function to generate a sequential number for each
document created under a specific MasterID. (Sample Code listed below as
Function GetDocNumber)
[DocumentID] - Combines the document's MasterID with its DocumentNumber to
create a unique ID.

frmDocPages (using tblDocPages as data source)

Fields:
[DocumentID] - Master ID (used to link to frmDocument)
[PageNumber] - Generates unique sequential number for each page
[PageName] - Name of the file (serves as the ID)
[ParsePart1] - used with a parsing function that splits the file name into
two components, (file name).
[ParsePart2] - used with a parsing function that splits the file name into
two components, (file extention).
[PageSize] - for keeping track of how much space is being used by the image
files. I do this because the images are being saved to a recordable CD, and
I have a separate form that shows the total amount of space used on the CD
so that the user dosen't exceed 550 MB.

Basically, I have my Scan button located on the frmDocument form. When
clicked, it opens the scanning interface. On the form you need to insert the
Kodak Image Scan Control (in my case, it's named as [ImgScan1]. I also have
an unbound control called [FullPath]. In the forms On Open Event, I have
the following code:

I use the following code on my command button:

Private Sub Form_Open(Cancel As Integer)
CurrentDBDir ' A function found on Dev Ashish's home page that returns the
path of the current DB.
Me!FullPath = CurrentDBDir & "TmpNDECS\" & "Page"
End Sub

In this case, I have the destination folder hard coded as TmpNDECS, though
you can code this as needed. The "Page" is the template for the IMGSCAN ocx
so that the files are named Page0001.tif.

On my command button On Click Event I have the following code:

Private Sub Command2_Click()

ImgScan1.ScanTo = 4 ' Scans the document as saves
it using a template
ImgScan1.Image = Me!FullPath ' Sets the Directory where images
are saved
ImgScan1.MultiPage = False ' Scans each page as saves them as
separate files
ImgScan1.PageCount = 0
ImgScan1.ShowSetupBeforeScan = True ' Shows the Scanner controls for
adjustment
ImgScan1.StartScan ' Actually opens the scanner
TWAIN

End Sub

Depending on your scanner and TWAIN, You may be able to have more control
over you scanning interface. You'll have to experiment.

Once all of the pages have been scanned, I have another button on the
frmDocument form that runs through several Do While ... Loops with nested
Dir() functions that grabs the file names, parses them, renames them, and
moves them to their proper directories. For viewing the images, i uses
expressions to "build" the full path that points to the directory where the
image resides. For example, When I create an entry for a new document, a
directory is created where the pages will be saved. This directory is named
the same as the document description. So for a form to view the image I
would use the following code to create the path:

Me![ImageFrame].Picture = CurrentDBDir &
[Forms]![frmDocument].[DocumentDescription] & "\" &
[Forms]![FrmDocument]![frmDocPages].[Forms].[PageName]

If you are interested, I can post the various bits code I used for this.
Many, such as the parsing function, I found on Dev's and other sites that I
have kludged together.

I hope that this sets you in the right direction. If you have any
questions, feel free to ask any questions you have to this thread. As I
stated at the begining, there dosen't seem to be a lot of info on the web
about these controls, so maybe we can work out how this thing works between
us so that future people won't have as many struggles as we have!

Good Luck!

Michael Logue


SSC wrote in message <85ti2t$hqs$1...@duke.telepac.pt>...

0 new messages