Click to See Complete Forum and Search --> : Find a record in a table MS Access


luke101
February 3rd, 2005, 01:07 PM
Hello, i am using c++ and I am connected to MS access. What I want to do is search the primary key then show the matching record in my program. I am very new to database programming and will need some kind of example on how to do this. Thank you

jp140768
February 4th, 2005, 11:35 AM
Not being a C++ programmer, I can't give you a specific example.

The SQL statement is:

Select * from table Where primarykey = abc

table = name of table that contains your data
primarykey = name of the field that contains your primary key
abc = whatever you're searching for.

In VB, we create a recordset using the recordset and then read the recordset.

HTH

JP

luke101
February 4th, 2005, 01:26 PM
hmmm..it seems that vb is much easier

Krzemo
February 5th, 2005, 04:24 AM
What interface? OLEDB\ADO\ODBC ?

luke101
February 5th, 2005, 11:04 AM
it is odbc

Krzemo
February 5th, 2005, 12:58 PM
http://www.codeguru.com/Cpp/data/mfc_database/odbc/print.php/c4303/

Hope it helps.