If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > .dbf query help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-09, 23:26
dukeofmuffins dukeofmuffins is offline
Registered User
 
Join Date: Jul 2009
Posts: 1
.dbf query help

I am trying to figure out how to make my program look into a database and pull one item.

For example, one of my tables has 2 columns, EMPLOYEE and PIN. Now the program (main form, ie form1) has a text box asking for a pin, then a button. I want to have it so when a number is entered and the button is clicked, the program looks in the database, finds that pin, then places the corresponding name into a variable. I managed the connection string (ODBC) and can see all the records from within visual studio, I just don't know what commands to use to query for that one piece of information and then how to bring it to the program and store it.

I haven't touched VB in sooo long and could really use a hand! These are simple .dbf files if that makes any difference.

-Graham
Reply With Quote
  #2 (permalink)  
Old 07-23-09, 00:36
UtOkbOlinAO UtOkbOlinAO is offline
Registered User
 
Join Date: Jul 2009
Posts: 11
* open ur database using ADO or DAO connection
* make a query out of it where the qualifier is the pin.
* open the recordset
* if found then store it in a variable
* if not found message box "pin not found."
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On