Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access connections through code

Status
Not open for further replies.

medicenpringles

Programmer
Aug 7, 2005
39
US
ok, this is going to sound a bit odd because i've never done this before, but here goes:

i have a cash register application that involves several classes and several forms. i have a Globals module that holds all my constants and such, and i have a class named "Prices" that holds all the prices of my products. that class has properties for the name and size of a product, and a big long complicated set of "Select Case" statements for the prices.

what i would like to do is have a database (which is already made) that i connect to through the Prices or Globals that stores all my prices. i want my Prices class to dynamically look up prize by name and size according to what controls the user inteacts with.

basically, i'm looking for the vb.net equivelent to the VLOOKUP funtion in excel, but for Access databases.

sry if that was confusing.

thanks
stephen

ps - i know this is probably all explained in the ADO.NET core reference, but i'm on a low budget right now.

Main Language: Visual Basic .NET
Development Environment: Visual Studio .NET 2003
 
summarization of above:
1) how do i connect to a access database programmatically?
2) how do i look up specific values in that database?

Main Language: Visual Basic .NET
Development Environment: Visual Studio .NET 2003
 
does no one know what i'm talking about? it doesn't seem that hard.

Main Language: Visual Basic .NET
Development Environment: Visual Studio .NET 2003
 
I think everybody thinks that you could easily look this up but me shall give it a try.

tip 1:
tip 2:
Code:
dim contemp as new oledbconnection
dim comtemp as new oledbcommand
dim adptemp as new oledbdataadapter
dim dttemp as new datatable

contemp.connectionstring = 'see tip1
comtemp.commandtext = "select * from sometable"
comtemp.connection = contemp
adptemp.selectcommand = comtemp
adptemp.fill(dstemp)

tip 3: "select * from sometable WHERE field = value"

tip 4: I'm in good mood.


Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top