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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving Integer from Table and Adding to it

Status
Not open for further replies.

Vicky999

Technical User
Mar 6, 2004
2
0
0
GB
Hi all,

I need to retrieve an integer value from an Access database, and display it on screen. I then need to add a value entered manually into another field to this existing number, which would update the database. For example:

Existing Integer: 7
Entered Integer: 8
Updated Integer (to take the plce of the existing integer): 15

Any help would be greatly appreciated!
 
You would issue an update statement which used the following style of code:

Code:
UPDATE myTable SET myColumn = myColumn + 8 WHERE dataPrimaryKey = x

You need to pull and store thet data from tha row that will uniquely identify the row for the WHERE clause in the update statement.

You just do the rest using the OleDbCommand object.

James :)

James Culshaw
james@miniaturereview.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top