Discussion in "General help Guidance and Discussion" started by    har    Dec 31, 2007.
Mon Dec 31 2007, 11:17 am
#1
how to create database and use it in Visual Basic annd further interface it with microcontroller
Mon Dec 31 2007, 03:48 pm
#2
very simple :-)

1. make a database file using MSAccess ..
let u create a database named "students.mdb" which has a table in it named "info".
let this table contains 2 fields named..."name" and "age".
2.
then u declare a database in vb as
 Dim db As Database
Dim rs As Recordset

3.
then u initialize database in vb as
Set db = OpenDatabase(App.Path & "\students.mdb")
Set rs = db.OpenRecordset("info", dbOpenDynaset)

4.
thats it.....now u can create new records,edit,delete records from it.
for example to create a new record, u write as
rs.addNew
rs.Fields("name")="abbas"
rs.Fields("age")="20"
rs.upDate

hope it helps :-)
 har like this.
Tue Jan 01 2008, 07:03 pm
#3
but how to interface this database with the microcontroller?
Tue Jan 01 2008, 08:00 pm
#4
1.first interface your microcontroller to your PC (serial/parallel/usb connection)
2. collect data from microcontroller in your vb program
3. send it to your database... or do wat ever u want
 har like this.
Wed Jan 02 2008, 10:56 am
#5
how to collect data from microcontroller in your vb program. can u please explain me with one technical example.
Wed Jan 02 2008, 05:19 pm
#6
let u have connected some sensor to uc.u want uc to read that sensor and send its data to pc (let say serially).
for this u first program ur microcontroller.
then u make a program in vb which reads data from serial port.
so whenever ur controller will send data, vb program will collect it .
and u can do whatever u want with that data

hope it will be clear now
Thu Jan 03 2008, 02:17 am
#7
just a hint.. check for MSCOMM in your VB
go to Project->Components->Microsoft Comm Control
just drag and drop in your project..
Wed Jan 30 2008, 02:02 pm
#8
why i can't define variable db as database? i use vb6 and ms access 2003
Wed Jan 30 2008, 09:13 pm
#9
ginseng
what error u r getting

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am