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

Searching through a Databse using SQL?

Status
Not open for further replies.

Skinsella

Programmer
Feb 20, 2001
23
GB
I'm writing all this in VB6, and was hoping to use an SQL statement within VB to search through my Database. "Test" is the name of the database, "TblRecord" is the name of the Table and "RecordName" is the name of a column in that table. "RecordName" is also the name of the TextBox which is used at run-time to search for a specific record name. "RecordName" is the primary key in the table, so once the user searches through the database and a record is found it displays the information contained in that record in other text boxes on the form. For example the user would type "Fred" in the "RecordName" TextBox, and then if a record is found it displays "txtMemberName", "txtMemberAge", "txtMemberAddress" all of which correspond to a column name in the database. My problem are How do I search the Database? and
How do I bring up the information, after it has searched, into the corresponding TextBox fields?
I'm using a Dataenvironment to connect to the SQL database if that helps. Anyone got any simple solutions?
 
Are you read SQLServer Database or Access 2000 database with Dataenvironment ? (and ADO 2.5 ?)
Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX.

Download Demo version on my Site:
Promotions before 02/28/2001 (free source codebook),visite my site
 
I'm reading the SQL server with the Data Environment. I've updated my system to ADO 2.6
 
SQLServer 2000 ( with Ado2.6 !!)

SQL = " Select * From Table Where Name =' " & RecordName & "'"

Now the connection to Open the table with Ado.

then

If not recordset.Eof then

txtMemberAdress = recordset!adres & ""
txtMemberName = recordset!membername & ""
etc...

end if




Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX.

Download Demo version on my Site:
Promotions before 02/28/2001 (free source codebook),visite my site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top