NANOSOFT (GAME & SOFTWARE DESIGNING) HNDEC-MTK & BIT-UOC
[email protected]
53
Temporally
Permanently Ex-) Game High Score Data Record sets
If data is a variable, we can use Variable Method to storage storage data in memory. memory. EX-) Dim Age As bite Public Salary As variant
Using DAO
Using Database
Using ADO
Using Spreadsheet
Using Data Grid
Using Notepad
54
1) Field Name (Should be single name) 2) Filed Type (String Type for Character type, Number for numeric, Yes/No Type for Boolean etc…) 3) Filed Size (According to the purposes)
Ex-) •
Table Name-STDATA.mdb
•
Save As-2000 Format, Because vb6 Developed by Microsoft In 2001.
55
Table Name-STDATA.mdb
•
Database Name-STUDENT.mdb
•
•
File Path-
•
VB Interface
1) To Connect Database with VB we add Microsoft DAO 3.6 (DLL File) Project-->Reference-->Microsoft DAO 3.6
2) Declaring Variables Database and Record set always changing. (we edit, save, delete…). So these are variables. We use a specific place to storage database in memory. RAM 3) Connect with our Database Project.
4) Showing connected data.
56
5) Records move 57
58
•
VB Interface
•
Write codes for records move. (Early mentioned).change the interface as follow. (NAME as NAME1 & NAME2).
59
Key field
****NOTERegno textbox(txtr) tab index shouldn’t equal to zero
****NOTEBut you cannot write code like this for save or edit.
60
Adding data to combo box
1.Using list of property window
2.Using codes Ex-1)
Ex-2)
A Loop
61
Ex-3)
Set database to vb and write code like this •
Ex-4)
•
•
Countering how many records are there… Then showing all data in record sets
Only 3 records display
62
Ex-1) One key field
Ex-2) Two key field
or
****NOTEYou cannot take different type of field as key field .
Ex-3)
63
•
Add items to Field combo box using list box
64
65
•
Two Key Fields
66
1) Add Microsoft FlexGrid Controller Project-->Components-->Microsoft FlexGrid Controller 6.0
2) Right click on FlexGrid and select Properties. Change these as follows.
3) Change FlexGrid name as MS.
4) Add a Combo box, Change Name as cmbr
•
VB Interface
Open lesson 02 vb project and edit these things
67
68
To separate specific type of field we use WHERE clause. EX-1) Open the Lesson 01 VB Project. Then edit only this.
Then connected with civil records only and other records neglected.
69
Declaring variables for STSUB table. Declaring variables for STINFO table. Declaring variables for STMARKS table.
EX-2) Create 3 databases. STMARKS table records should be empty. 70
VB Interface
a Key Field
71
WHERE clause.
72
Three Key Fields
VB 6.0 1.VB Basic (1st Semester)
2.Data Storage (2 nd Semester)
I.
Introduction
I.
Introduction
II.
Standard Names
II.
Database
III.
Simple Codes
III.
What is .EXE?
IV.
Print Method
IV.
What is DLL?
V.
Numerical Calculations
V.
What is ADO & ODA?
VI.
Variable Method
VI.
What is OLE?
VII.
Conditional Statements
VII.
Lesson 1
VIII.
Message Boxes
VIII.
Lesson 2
IX.
Optional Buttons
IX.
Lesson 3
X.
Lesson 4
X.
Loops
XI.
Lesson 5
XI.
Functions
XII.
Data grid
XIII.
Lesson 6