using vb to search a database n return data

CoBoL666
CoBoL666 used Ask the Experts™
on
hi....i am a lil new at the whole vb thing so i figre the only way to learn is to ask right?

here goes:

i need to create a vb program that allows me to insert a name/number/date into a text fireld n then the program searchs the database for that n returns all information on that record.

i.e. if i type in txtbox1 (alan) it will return alans name, adress, tel no, n d.o.b.

somthing along those lines.

i know this is a simple question for all you experts out there but give a nebie a break....whadya say.

also is thier anyway to add data to a database use vb?

thanx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Search www.planetsourcecode.com and you will get plenty of applications for your requirement.
You need to look at using ADO to connect to your database, although how you do this depends on what database you're using.
This should help you a little with ADO connection strings:
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm

Once you've got that sorted, you need a recordset which uses the connection to run some SQL.  This SQL is something like "SELECT * FROM AddressTable WHERE Name = 'Alan'"

To add data, you can use the same connection to execute SQL:

Dim Conn As Connection
Set Conn = New Connection

Conn.Open ConnectionString ' Whatever your connection string is for your database

Conn.Execute "INSERT INTO AddressTable (ListOfFields) VALUES (ListOfValues)"



Oh, and don't forget to close and deallocate everything when you've finished:

Conn.Close
Set Conn = Nothing


HTH

Flynnious

Commented:
If you want complete code for developing search engine then just specify ur detailed requirements at vinusa500@yahoo.com

Vinay!

Commented:
If you want complete code for developing search engine then just specify ur detailed requirements at vinusa500@yahoo.com

Vinay!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial