Discussion Locked

Access data in the database

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all, i would like to know how to access data in the database using vb6 and the database in ms access 2007. for example i have a table in the database called item, with data fields such as itemname, item-id ,etc, so if i want to access the data in this table suppose in itemname, wat code must i put in vb6 to access this? Supposed i want a total of all the items in the table..i have connected my db using adodc.

please help..
thanx

10 replies

by sacky4e

Thanx for the reply.. i do know how to do that in access, my question is how can i call for that total in vb forms.. coz am developing a point of sale system and want to know how to add up all the sale prices for the day without necessarily doing it in vb.

The other problem is how can i decrement the value in the database if an item is bought out..

More help needed

by tony hopkinson

Didn't even post this in questions, so you could not bother giving me thumbs up anyway.

Those questions suggest to me that you don't understand what you know.

A query to total stuff up is just a query like any other.

"Select Sum(SaleValue * SaleQty) as TotalSales From Sales Where DateOfSale = GetDate()"

So if you can do select * from Sales, you can do somthing like the above.

If you can't then you ned to google and find out, it's not hard.

If are SQL you are struggling with, then there are some good tutorials out there, again find from google.

Changing a database value is just another query, an Update statement e.g.
Update Item Set ItemQty = ItemQty - 1 Where ItemID = ....

When you execute the Command, pick the method that expects no results.

A bit of effort and you could have answered this yourself in about ten minutes given some background knowledge. If you want to make a go of it as a developer, you need to exert yourself a bit more.

by shellbot

Ya, I was thinking I wasn't going to waste my precious time explaining it all when there is so much info on VB & ADO out there...

Its one thing to have a specific question or problem..but he doesn't seem to understand enough to look himself..so..not that I'm not up for sharing knowledge..but to teach from the ground up..I invoice for that kinda stuff :)P

by sacky4e

Thanx guys for your help.. will definetly do wat u told me to do and come back when i get smthing

by tony hopkinson

Normally we get hassled for not being helpful enough and posting the code for the entire application.

Thank you.

by shellbot

At this stage I'm hardly qualified..
Don't touch Access unless absolutly have to..and VB6 wow..haven't used it in ages..
moved onto .NET and even then have hardly used it.
Don't really develop much, only reason I keep up to date is for Level 3 support reasons

by shellbot

Well, its nice to see that not everyone expects you to do thier work for them.
:)

This discussion is closed to new replies.