Click here to Skip to main content
15,909,205 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Database search in vb6 Pin
offroaderdan22-Dec-09 8:32
offroaderdan22-Dec-09 8:32 
GeneralRe: Database search in vb6 Pin
Luc Pattyn22-Dec-09 8:36
sitebuilderLuc Pattyn22-Dec-09 8:36 
GeneralRe: Database search in vb6 Pin
offroaderdan22-Dec-09 8:40
offroaderdan22-Dec-09 8:40 
GeneralRe: Database search in vb6 Pin
Eddy Vluggen22-Dec-09 9:39
professionalEddy Vluggen22-Dec-09 9:39 
GeneralRe: Database search in vb6 Pin
offroaderdan22-Dec-09 10:59
offroaderdan22-Dec-09 10:59 
GeneralRe: Database search in vb6 Pin
offroaderdan22-Dec-09 11:09
offroaderdan22-Dec-09 11:09 
GeneralRe: Database search in vb6 Pin
Md. Marufuzzaman22-Dec-09 11:22
professionalMd. Marufuzzaman22-Dec-09 11:22 
GeneralRe: Database search in vb6 Pin
Eddy Vluggen22-Dec-09 11:57
professionalEddy Vluggen22-Dec-09 11:57 
Usually I'd agree with getting a book first, but VB6 is a piece of antique. You fix it and get the Hell out or there Smile | :)

Let's try and divide it into two separate problems; first you'd need to get an argument from a textbox. The second task is to use this argument in the SQL statement. So, the code would be changed to something like this;
Dim Arg$
Arg$ = txtSearch.Text

Dim Statement$
Statement$ = "SELECT * FROM [tablename] WHERE [First_Name] = '" & Statement$ & "'"

DataGrid1.RecordSelectors = Statement$
This is not the "ideal" construct, as it leaves you vulnerable to hackers. That's something that you can worry about when the code works though. Put a breakpoint on the last line by clicking in the gutter, run your code and press Ctrl-G when you reach the breakpoint. That will cause the "immediate"-window to pop up.

Type "? Statement$" and press enter in that Window. VB6 should react by showing you the contents of the Statement$ variable. You can copy/paste this SQL-statement here, if you want to have it verified.

I are Troll Suspicious | :suss:

GeneralRe: Database search in vb6 Pin
offroaderdan22-Dec-09 23:24
offroaderdan22-Dec-09 23:24 
GeneralRe: Database search in vb6 Pin
Eddy Vluggen23-Dec-09 0:39
professionalEddy Vluggen23-Dec-09 0:39 
GeneralRe: Database search in vb6 Pin
offroaderdan23-Dec-09 7:20
offroaderdan23-Dec-09 7:20 
Question[Message Deleted] Pin
manisghouri22-Dec-09 5:06
manisghouri22-Dec-09 5:06 
AnswerRe: Technical documentation of a software [modified] Pin
Dr.Walt Fair, PE22-Dec-09 5:48
professionalDr.Walt Fair, PE22-Dec-09 5:48 
QuestionWriting the content of a text file Pin
hvgyufg28fh38tyr78hf22-Dec-09 2:38
hvgyufg28fh38tyr78hf22-Dec-09 2:38 
AnswerRe: Writing the content of a text file Pin
Ashfield22-Dec-09 2:42
Ashfield22-Dec-09 2:42 
AnswerRe: Writing the content of a text file Pin
Luc Pattyn22-Dec-09 2:42
sitebuilderLuc Pattyn22-Dec-09 2:42 
AnswerRe: Writing the content of a text file Pin
#realJSOP22-Dec-09 4:09
professional#realJSOP22-Dec-09 4:09 
GeneralRe: Writing the content of a text file Pin
hvgyufg28fh38tyr78hf22-Dec-09 5:23
hvgyufg28fh38tyr78hf22-Dec-09 5:23 
GeneralRe: Writing the content of a text file Pin
#realJSOP22-Dec-09 8:27
professional#realJSOP22-Dec-09 8:27 
AnswerRe: Writing the content of a text file [modified] Pin
plecco22-Dec-09 8:41
plecco22-Dec-09 8:41 
Questionupdate data? Pin
cotdot1111122-Dec-09 1:33
cotdot1111122-Dec-09 1:33 
AnswerRe: update data? Pin
Vimalsoft(Pty) Ltd22-Dec-09 2:30
professionalVimalsoft(Pty) Ltd22-Dec-09 2:30 
AnswerRe: update data? Pin
The Man from U.N.C.L.E.22-Dec-09 7:06
The Man from U.N.C.L.E.22-Dec-09 7:06 
AnswerRe: update data? [modified] Pin
plecco22-Dec-09 8:44
plecco22-Dec-09 8:44 
QuestionHow to fetch cell value in MsFlex Grid in vb6.0? URGENT Pin
Ashish Kumar Vyas21-Dec-09 23:01
Ashish Kumar Vyas21-Dec-09 23:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.