Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 29th, 2006, 03:12 PM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default database help

I am currently working on a senior project for school.
I am using an rfid reader that will read tags and display the tag number in ms access.
I want to link the individual tags to a person that I will just make up so when a tag is read it will display that person's info.
The code is below that came with the reader.
Code:
Option Compare Database

Private WithEvents PM As PHIDGET.PhidgetManager
Dim WithEvents RF As PHIDGET.PhidgetRFID
Dim strLastTag As String

Private Sub Form_Load()

    Set PM = New PHIDGET.PhidgetManager

    Call But_ClearTable_Click

    'Use the following code to attach reader directly without using the PhidgetManager
    'Set RF = New PHIDGET.PhidgetRFID
    'Call RF.Open(False)

End Sub

'When the reader appears, assign the events to RF
Private Sub PM_OnAttach(ByVal PHIDGET As IPhidget)
    If PHIDGET.DeviceType = "PhidgetRFID" Then
        Set RF = PHIDGET
        lblAttached.Caption = "PhidgetRFID" & " Version " & RF.DeviceVersion & ", Serial# " & RF.SerialNumber

        'Check the form to determine if the Reader has been enabled and set it on the device
        If chkDigitalOutput3 Then RF.OutputState(3) = True Else RF.OutputState(3) = False

    End If
End Sub

Private Sub chkDigitalOutput0_Click()
    If chkDigitalOutput0 Then RF.OutputState(0) = True Else RF.OutputState(0) = False
End Sub

Private Sub chkDigitalOutput1_Click()
    If chkDigitalOutput1 Then RF.OutputState(1) = True Else RF.OutputState(1) = False
End Sub

Private Sub chkDigitalOutput2_Click()
    If chkDigitalOutput2 Then RF.OutputState(2) = True Else RF.OutputState(2) = False
End Sub

Private Sub chkDigitalOutput3_Click()
    If chkDigitalOutput3 Then RF.OutputState(3) = True Else RF.OutputState(3) = False
End Sub

'When the event OnTag is thrown by the PhidgetRFID Reader
Private Sub RF_OnTag(ByVal TagNumber As String)

    'If the TagNumber is the same as the last tag then ignore it
    If chkOnlySingleEntries Then
        If TagNumber = strLastTag Then Exit Sub
    End If

    Me.[TblTagIDs subform].Form.Recordset.AddNew
    Me.[TblTagIDs subform].Form.Recordset!tagid = TagNumber
    Me.[TblTagIDs subform].Form.Recordset.Update
    strLastTag = TagNumber

End Sub

'Delete all lines from the table TblTagIDs
Private Sub But_ClearTable_Click()
    CurrentDb.Execute "DELETE FROM TblTagIDs;"
    Me.TblTagIDs_subform.Requery
End Sub


'When the reader disappears, say so
Private Sub PM_OnDetach(ByVal PHIDGET As PHIDGET.IPhidget)
    If PHIDGET.DeviceType = "PhidgetRFID" Then
        lblAttached.Caption = "Attach an RFID tag reader"
        Set RF = Nothing
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Call But_ClearTable_Click
End Sub
any suggestions.
thanks pete






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to restore database in C#2005 database acmuralee MySQL 0 March 25th, 2008 04:42 AM
Microsoft JET Database Database Engine (0x80040E09 cannielynn0312 Classic ASP Professional 2 December 17th, 2007 02:50 AM
Copying Table From one Database To Anoter Database jayanth_nadig VB Databases Basics 1 June 19th, 2006 02:39 PM
Upload image to database or not to database? thachnn SQL Server ASP 0 October 11th, 2004 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.