Solved

Scanner question...

Posted on 2000-03-02
2
208 Views
Last Modified: 2010-05-02
How can I from VB, check is a scanner is connected and if it is ON.

And also, how can import a part of a picture in the scanner to a database, and give it(picture) a name.

Please help me, I really need it

Source code will be nice
Thanks
0
Comment
Question by:fguerreiro_inix
2 Comments
 

Accepted Solution

by:
moshepeled earned 400 total points
ID: 2576204
Use the wang control !
it's free and you can got the status of the Scanner

other function of the wng is the UniqeNumber , when you create new image
you run the Method of UniqeNumber and it will be save the image to the destination directory with Uniqe name
now just collect it in Blob field in your DB


I hope i was hellped.
Moshe,
mpeled@iname.com
http://back.to/mp
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2576231
Storing images in a database is a BAD idea. Although you can save them with the BLOB method, the problem arises when you want to show the image back to the user. The LoadPicture method only works from disk so you have to pull the data out of the database, write it to disk and then reload it into the control. The first two steps make it 2x slower than if you just leave the image out on disk. This question comes up all the time. Keeping images in the database also causes your database to rapidly bloat and doesn't scale. If you simply keep a pointer to the external file in the database instead of the image itself you get much faster operation and you'll be able to store tons more data than you would keeping the images inside. You can even have the images spread over several directories/drives/servers to have more images online than you can fit on any single disk volume.

As for testing the scanner from vb, you shouldn't tie your program that tightly to the scanner. Simply fire off the TWAIN compliant device and let the OS worry about managing the hardware. This will allow your code to automatically adapt to different hardware configurations and is consistent with the hardware management structure of windows.

M
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now