General discussion


Access data in the database

By sacky4e ·
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..

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -


by Tony Hopkinson In reply to Access data in the databa ...

VB6 ADO Access

Millions of examples.

If you want a total

you do a query something like

select sum([item-value] *[item-count]) from item

you do not add them in vb6.

ps stop using - in your field names, it's irritating. Use legal idenifiers then you don't have to wrap every one in [] or "" or ``

Collapse -

Access data in database

by sacky4e In reply to Google

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

Collapse - some research

by Shellbot In reply to Access data in database

not saying can't help you..but i'm getting the feeling that you don't know anything about ADO.. ??

Check this out..then get back to us with more specific questions ok:

Collapse -

Cheeky wee fooker aren't you ?

by Tony Hopkinson In reply to Access data in database

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.

Collapse -


by Shellbot In reply to Cheeky wee fooker aren't ...

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 that I'm not up for sharing knowledge..but to teach from the ground up..I invoice for that kinda stuff :)P

Collapse -

Haven't done access for a decade

by Tony Hopkinson In reply to LOL

or VB6 for six years, so there'll be no competition from me if you give him a quote.

Collapse -


by Shellbot In reply to Haven't done access for a ...

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

Collapse -

thumbs up guys

by sacky4e In reply to Cheeky wee fooker aren't ...

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

Collapse -

Cheers mate

by Shellbot In reply to thumbs up guys

Will be glad to help more when you've done a bit of background work
Good luck

Collapse -

I think that's a first.

by Tony Hopkinson In reply to Cheeky wee fooker aren't ...

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

Thank you.

Related Discussions

Related Forums