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

Dynamic query..?

Status
Not open for further replies.

kenjoswe

Technical User
Sep 19, 2000
327
SE
Hi all,

How can I retrive records in VB6 using a value from a TextBox into a SQL-query?

Something like:
select * from Table1 where Field1= TextBox1

/Kent J.
 
Yes, you are on the right track. just make sure you concatenate correctly. Below is an example of how to concatenate your sql string.

"SELECT * FROM DB.dbo.TABLE_NAME WHERE User_name = '" & text1.text & "'"
 
"select * from Table1 where Field1 = " & texbox1.text

-Mats
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top