Go Down

Topic: Using Data in table of Access DB (Read 519 times) previous topic - next topic

MKSaeed

Hi Guys,

I created a database table with MS Access and connected with Visual studio and I want to know if it's possible if Arduino can retrieve the data in Access table and use it in it's variable. Can I do this with MS access or need Mysql database ?

My issue is how to read the data in the db table

Thanks

Robin2

#1
Nov 05, 2018, 11:11 pm Last Edit: Nov 05, 2018, 11:12 pm by Robin2
An Arduino cannot do anything with data while it is in files on your PC. You need a program running on the PC to gather the data and pass it to the Arduino.

As far as receiving the data on the Arduino is concerned have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

PaulS

Quote
and connected with Visual studio
Nonsense. Visual Studio can not connect to any database. Applications written USING Visual Studio can, but that is nowhere near the same thing.

Quote
I want to know if it's possible if Arduino can retrieve the data in Access table
No, it is not.

Quote
My issue is how to read the data in the db table
Which isn't an Arduino issue.
The art of getting good answers lies in asking good questions.

sterretje

#3
Nov 06, 2018, 06:23 am Last Edit: Nov 06, 2018, 06:23 am by sterretje
Your PC application can read (and write) the Access database.
Your PC application can read and write a serial port.

So you can e.g. send a command from the Arduino to the PC application like <r,1> to read the first record or <r, arduino> to get all records containing arduino.

The PC application will query the Access database and return the requested record(s) to the Arduino via the serial port.

PS
Command format based on the link that Robin posted in reply #1
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

MKSaeed

Thank you all for reply..

Quote
So you can e.g. send a command from the Arduino to the PC application like <r,1> to read the first record or <r, arduino> to get all records containing arduino.
Could you guide me with example which I can understand it.

because in my case like this:

I have 3 RFID cards for dogs and cat for feeding. and I made a windows Application form with MS access db to create a table contain : " Dog name, RFID Tag number per each dog, the food amount, and the time with date" so when dog come to feeder the feeder will read the tag and know if the dog's time for feeding will serve him his food amount and type.


So I want Arduino to check the RFID tag with date/time to look into table and see if match open the servo to serve if not will not open.

Thanks for all

Robin2

So I want Arduino to check the RFID tag with date/time to look into table and see if match open the servo to serve if not will not open.
How to write a program for your PC is outside the scope of this Forum but there are probably hundreds of online tutorials on other websites that will help you to learn.

To do what you want your Arduino needs to read the RFID tag and then send a message to your PC program containing the details from the RFID tag. After that the PC program will compare the details with those in the database and send a message back to the Arduino telling it whether there was a match.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

MKSaeed

@Rbin

Thank you very much.

Yes I know the the pc program is not here  :)  I already made the program using VB and MS Access for Database. but I want to know how to send the order to open servo connected with Arduino.

Thank you again for give me an Idea...that I will work now on let the PC program decide and send order to Arduino instead of make Arduino decide!

I will work on it.

thank you

Robin2

It's a long time since I used Windows so I have no advice to offer about Windows-specific programming.

This Python - Arduino demo illustrates both sides of the communication. It should not be difficult to adapt the concepts to your favourite programming language.

Alternatively, if you want to use Python my example should work on Windows with appropriate adjustment to the serial port references.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

MKSaeed

I don't know how to thank you! Again thank you very much I will work on it.

Quote
This Python - Arduino demo illustrates both sides of the communication.
you mean that I need to use python with Windows program to be able to send serial/Ethernet signal to Arduino? Can not do it directly from VB script ?

Thanks :)

PaulS

Quote
you mean that I need to use python with Windows program to be able to send serial/Ethernet signal to Arduino?
No. Python is just one option.

Quote
Can not do it directly from VB script ?
Can you? Only YOU know what YOU can do.
The art of getting good answers lies in asking good questions.

Robin2

you mean that I need to use python with Windows program to be able to send serial/Ethernet signal to Arduino? Can not do it directly from VB script ?
No.

If you read Reply #7 carefully you will see that I wrote "It should not be difficult to adapt the concepts to your favourite programming language."

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Whandall

I have 3 RFID cards for dogs and cat for feeding. and I made a windows Application form with MS access db to create a table contain : " Dog name, RFID Tag number per each dog, the food amount, and the time with date" so when dog come to feeder the feeder will read the tag and know if the dog's time for feeding will serve him his food amount and type.
I think a database is overkill for a table with three rows of a couple of values,
which could easily fit into the onboard EEPROM.
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

MKSaeed

I came here to thank you all . I made the VB program and connected with Arduino UNO serial.

Thank you Robin2 for your reference it really help me. Thank you

Go Up