Computing.Net > Forums > Programming > Really need a help (VB and database SQL

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Really need a help (VB and database SQL

Reply to Message Icon

Name: IDA_NS
Date: March 21, 2002 at 01:24:53 Pacific
Comment:

Hiii...
I'm now developing a project final called "Staff Tracking System". This system is to monitor a staff moving in or out from office trough eletronic door.Actually,that system is an upgraded system for the vendor software(Purchase). The vendor software using a device like staff card(have a unique card number), a sensor attached to electronic door, reader, controller and serial port(RS232)connected to PC(running Win98). The weakless of this system is it a stand alone system and doesnt have a specific database. So, I need to make a database and publish into web pages. I'm using a VB 6.0 for the interface and Microsoft SQL 7.0 for a Database. The problem is, I need to know what is the data that received from the controller when staff swipe their card at sensor. So I make a sniffer program using VB (ComPort program). And I send a few command like "D0 4C 43 0D"(founding from port monitor, and it might be more command should be sending trough sniffer program).Now, I have received the data. The data is sending in term of, something like
Com1: 19030830 '8 length
Com1: 0065420 '7 length
Com1: also '8 length
Com1: also '7 length
'and so on.

when I investigate the received data, i found that 8 length data is set to DATE and TIME, 7 length data is set to Card Number and Status Transaction in term of code.
For example,
Com1: 19030830 means
19=Day; 03=Month; 0830=Time
Com1: 0065420 means
006542=Card Number; 0=Transaction Code
P/s: there is 28 types of transaction code
setting in the existing vendor's
software. One of them is, O for "Valid
Entry.

Now, the sniffer program have received the nonstop data.
1. What should I do to to splid the received
data into;
Day = 19
Month = 03
Time = 0830
Card number = 006542
Transaction Code= 0
and then display it on textbox. Cause I
must send the data into database SQL 7.0 .

3. What command should I add in my sniffer
program to clear the controller but not
clear the card number?
2. My supervisor ask me to do a database
design (make a table and also ERD
(Entity Relationship Diagram).

1. Table 1 : tbl_EventLogger


FIELD NAME DATA TYPE LENGTH
No INTEGER 5
TimeData DATE/TIME 20
CardNum INTEGER 15
TransCode VARCHAR 3

P/s: tbl_EventLogger connected into
tbl_TransCode and tbl_Staff

2. Table 2 : tbl_TransCode

FIELD NAME DATA TYPE LENGTH
TransCode VARCHAR 3
TransCodeDescp VARCHAR 25


3. Table 3 : tbl_Staff

FIELD NAME DATA TYPE LENGTH
Index INTEGER 5
StaffNum VARCHAR 15
CardNum INTEGER 15
PIN VARCHAR 10
StaffName VARCHAR 60
DoorAcc VARCHAR 30
FloorAcc VARCHAR 30
Position VARCHAR 35 Department VARCHAR 50


4. Table 4 : tbl_Reader

FIELD NAME DATA TYPE LENGTH
No INTEGER 5
ReaderName VARCHAR 30
CtrlType VARCHAR 15
Description VARCHAR 30
LogicPoint# VARCHAR 5
LocCode VARCHAR 35

So, how should I proceed this table into ERD?
(include PK and FK)



Sponsored Link
Ads by Google

Response Number 1
Name: Mark
Date: March 22, 2002 at 09:29:27 Pacific
Reply:

firstly

Each table needs it own unique autogenerated id number.

which is the main table, when that has been found the other table which link directly to it need to have an id field the sames as the main table (a linking field) then you can define whether the child field has a 1 to 1 relationship or 1 to many, manay to many etc etc.

thats a relational database,

strycture could be like

tab 1(card details)

tab 2(where datais sent to) is a child table off tab 1, which will have a 1 - many relation ship to tab one, allowing more than one entry per card.

there for you would have 1 card detail entry and several card entry and exit times,

displayedin a form would have tab 1 main form, with tab 2 sub form, linked across on ids to show history of card actions.

i can build you a basic structure and example using access if you want

relational databases are easy really


0

Response Number 2
Name: Kervin Morales
Date: May 6, 2002 at 07:31:56 Pacific
Reply:

I have made a program that read and write records. I made the data base in MS Access.
One of my 4 table have 3 relationship from the other table. When I try to add a new record to the Demerit table (the one with the
3 relationship) give me an error code. "error code 91 Set or With block undeclared" something like that. I'm using 3
data combo to display the fields in the form.
the code is as follow:
frmDemerit.adoDemerit.recordset.addnew
" ".field(" ")= data combo
and so on.
frmDemerit.adoDemerit.recordset.update
I you can help me or have any coment please let me know.
Kervin Morales
nivrekc@yahoo.com


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Really need a help (VB and database SQL

need the help of a wise human!(c++) www.computing.net/answers/programming/need-the-help-of-a-wise-humanc/7950.html

need a game in c++ www.computing.net/answers/programming/need-a-game-in-c-/11325.html

I need a WORKING and FREE BAT comp. www.computing.net/answers/programming/i-need-a-working-and-free-bat-comp/11892.html