help in barcode in vb!

help how to connect.. and other

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 3269 Views - Last Post: 20 January 2011 - 06:36 AM Rate Topic: -----

#1 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

help in barcode in vb!

Posted 12 January 2011 - 05:15 AM

HELP!! i need to know how to connect the Barcode scanner to VB.

i dont have a barcode scanner but i want to know first if i can do it or not >.<

the program is like a ID system that if you swipe the Barcode the PIC and the Other INFO will pop up the screen and the time is added at the database. but how?!

and last thing i know how to connect VB to MSAccess but only in DataGrid but how can i retrieve the all the INFORMATIONS in a single LABEL? or textbox? like the appearance of the ordinary ID?

please help me :helpsmilie:

Is This A Good Question/Topic? 0
  • +

Replies To: help in barcode in vb!

#2 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: help in barcode in vb!

Posted 12 January 2011 - 05:20 AM

a barcode scanner returns a plain ASCII string. just open a notepad and scan a random barcode and you will see what it decodes. For your application is enough to put a textbox and be sure it has the focus when user scans the barcode.
for your other question, use a RecordSet to retrive data from access. And then assign to your controls a value from recordset. I think you will find usefull tutorials and snippets in the correspondent sections of this forum.

Good luck,
Ionut
Was This Post Helpful? 0
  • +
  • -

#3 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 12 January 2011 - 05:40 AM

aah!.. thanks! i have an idea about that and the recordset too!.

but my problem is, i dont have a barcode scanner and i dont have any idea about the actual actions in the barcode and the scanner, and how to focus the scanned code to the text box?

and what if i have a scanner already, how can i register the barcode to the database?

tnx a lot for helping me..


sorry for the bad english >.<
Was This Post Helpful? 0
  • +
  • -

#4 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: help in barcode in vb!

Posted 12 January 2011 - 05:52 AM

Quote

and how to focus the scanned code to the text box?

On form_load event, set focus on that textbox. If the user changes the focus on other control,he should be aware that he has to set back the focus manually(if he wants to enjoy of this feature)

Quote

i dont have any idea about the actual actions in the barcode and the scanner

I don't think I follow. A scanner reads a barcode and outputs a decoded value to the PC.
In most cases, the barcode is the same number as you see it under the bars: e.g. 1244313 (or something)

Quote

and what if i have a scanner already, how can i register the barcode to the database?

Register it as text or integer(tricky here, you have to do a research to be sure that all barcodes are represented with digits). You register the value that is decoded by the scanner(as in above example). Then you make the search after that barcode.
Was This Post Helpful? 0
  • +
  • -

#5 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 12 January 2011 - 06:13 AM

can you give me the right syntax to setfocus the text?..

i try 2 code the "Text2.SetFocus" in the Form_load event

but it was an error Invalid procedure call or argument

hehehe >.<

~~~~~~~
aaa!!! i got it!! if the barcode scanner scanned a barcode it directly decodes it from the PC?.. so it must be pointed at the note pad or something to write the decoded codes? i am right?..
*please understand my english* :pinch:
Was This Post Helpful? 0
  • +
  • -

#6 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: help in barcode in vb!

Posted 12 January 2011 - 07:23 AM

look at this thread


Quote

aaa!!! i got it!! if the barcode scanner scanned a barcode it directly decodes it from the PC?.. so it must be pointed at the note pad or something to write the decoded codes? i am right?..


yes, you are right
Was This Post Helpful? 0
  • +
  • -

#7 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 12 January 2011 - 07:50 AM

View PostIonut, on 12 January 2011 - 06:23 AM, said:

look at this thread
YES!!! TNX!!! for this!

yes, you are right


yeah!!! tnx a lot sir!,
i learn more about vb because of you! tnx tnx!
i hope i will clearly do this application!

thanks a lot ! :smile2:

````````````````````
if i have a problem can i ask again to you ha!
tnx ahahaha :D
Was This Post Helpful? 0
  • +
  • -

#8 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: help in barcode in vb!

Posted 12 January 2011 - 07:54 AM

You're welcome.
If you have other problems, you can ask on this forum, there are many other people willing to help :)
Was This Post Helpful? 0
  • +
  • -

#9 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 12 January 2011 - 08:16 AM

View PostIonut, on 12 January 2011 - 06:54 AM, said:

You're welcome.
If you have other problems, you can ask on this forum, there are many other people willing to help :)


one thing again! hehehe..
i want to get the actual time,
but when i use this
" Label3.Caption = "time:" & Format(Time, "short time") "

the output is " time: 1:09 "
how can i get the time without the word "time" ?
is there any way?
Was This Post Helpful? 0
  • +
  • -

#10 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: help in barcode in vb!

Posted 12 January 2011 - 08:20 AM

Quote

" Label3.Caption = "time:" & Format(Time, "short time") "


Deleting "time:" from the right side of the assignment?

Label3.Caption = Format(Time, "short time")



p.s.: please use code tags([ code ] and [/code ] - without spaces). Makes the code easier to read and understand.
Was This Post Helpful? 0
  • +
  • -

#11 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 15 January 2011 - 11:11 PM

View PostIonut, on 12 January 2011 - 08:20 AM, said:

Quote

" Label3.Caption = "time:" & Format(Time, "short time") "


Deleting "time:" from the right side of the assignment?

Label3.Caption = Format(Time, "short time")



p.s.: please use code tags([ code ] and [/code ] - without spaces). Makes the code easier to read and understand.


tnx for this!

can i ask again? it is possible to store picture to the database?
because i want to have a data retrieving w/ pictures..
i know how to code the photo viewer.. but it is possible to save in the database?
Was This Post Helpful? 0
  • +
  • -

#12 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10771
  • View blog
  • Posts: 40,115
  • Joined: 27-December 08

Re: help in barcode in vb!

Posted 15 January 2011 - 11:17 PM

You shouldn't store pictures directly in the database. Store the image as a File on the server, and the path in the database.
Was This Post Helpful? 0
  • +
  • -

#13 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 16 January 2011 - 04:40 AM

View Postmacosxnerd101, on 15 January 2011 - 11:17 PM, said:

You shouldn't store pictures directly in the database. Store the image as a File on the server, and the path in the database.


aa ok.. but how?

 private Sub cmdShow_Click()
Dim ImageName As String
If Right(filImage.Path,1) = "/" Then
ImageName = filImage.Path + filImage.filename
Else
ImageName = filImage.Path + "/" + filImange.filename
End If
lblImage.Caption = ImageName
imgImage.Picture = LoadPicture(ImageName)
End Sub 

this is how to view a image but how to save ?
i want to have a database saving and retrieving with images eh..
but i dont know how.. :helpsmilie:
Was This Post Helpful? 0
  • +
  • -

#14 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,796
  • Joined: 26-March 09

Re: help in barcode in vb!

Posted 16 January 2011 - 11:48 AM

As macosxnerd101 as said, store the images on the hard disk and store the path in the database.

It's not really efficient to store images in the database.

You would store a path in the database against a patient ID, then when you want to load a patient record, you load the image as per your code using the file path you retrieve from the database.

You store the path the same way as you would store any other string datatype in the database.
Was This Post Helpful? 0
  • +
  • -

#15 saren  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 12-January 11

Re: help in barcode in vb!

Posted 17 January 2011 - 08:41 AM

View Postmaj3091, on 16 January 2011 - 11:48 AM, said:

As macosxnerd101 as said, store the images on the hard disk and store the path in the database.

It's not really efficient to store images in the database.

You would store a path in the database against a patient ID, then when you want to load a patient record, you load the image as per your code using the file path you retrieve from the database.

You store the path the same way as you would store any other string datatype in the database.


i know how to save the path in the database but in text form like
" D:\vb6.jpg "

this is the code for saving the image path from the database
 Form1.Adodc1.Recordset!Name = File1.Path + File1.FileName


NOTE:
 Dim ImageName As String 

but how to retrieve the image from the database in text form to the image?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2