Kick Drawer

danian

Registered User.
Local time
Today, 10:25
Joined
Jun 27, 2005
Messages
54
I have found 2 pieces of code on the internet that should open COM3 and fire a kick to open a cash drawer. The code is in VB, but I want to use this in an access database. The code is

1.)
Dim iFile As Integer
Dim arrbData() As Byte

iFile = FreeFile
Open "COM3" For Binary Access Write As #iFile
ReDim arrbData(1 To 4)
arrbData(1) = &H1B '27 in hexadecimal
arrbData(2) = &H70 '112 in hexadecimal
arrbData(3) = &H0 '0 in hexadecimal
arrbData(4) = &H30 '48 in hexadecimal
Put #iFile, , arrbData
arrbData(3) = &H1
arrbData(4) = &H31
Put #iFile, , arrbData
Close #iFile


2.)
Open "COM3" For Output As #1
Print #1, Chr$(27); Chr$(112); Chr$(0)
Close #1



But I can not get either to run. I have attached the DB.

Is it pos to run VB in access and if so how. Would this code even work to fire a cash drawer
 

Attachments

are you talking about cache as in memory cache?
 
modest said:
are you talking about cache as in memory cache?

Not a clue what you are talking about! I have found the above code and just trying to get it to work. not very good with vb.

really need some help though...
 
I have managed to find a fix. I have found this piece of code that works great:

var = "com3"
Open var For Output Access Write As #1
Print #1, Chr$(27); "p"; Chr$(48); Chr$(25); Chr$(250);
Close #1

Thanks for the help:

Danian
 

Users who are viewing this thread

Back
Top Bottom