Click here to Skip to main content
15,906,626 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to get a list of installed applications and uninstall them ? Pin
Lucifer Morningstar19-Dec-18 22:59
Lucifer Morningstar19-Dec-18 22:59 
SuggestionRe: How to get a list of installed applications and uninstall them ? Pin
CHill6019-Dec-18 23:07
mveCHill6019-Dec-18 23:07 
AnswerRe: How to get a list of installed applications and uninstall them ? Pin
Richard MacCutchan19-Dec-18 23:22
mveRichard MacCutchan19-Dec-18 23:22 
AnswerRe: How to get a list of installed applications and uninstall them ? Pin
Eddy Vluggen20-Dec-18 0:39
professionalEddy Vluggen20-Dec-18 0:39 
QuestionTrying to create a search query that will bring the results searched in access database. It is bringing up an error runtime error '3075' Pin
Member 1409033914-Dec-18 22:07
Member 1409033914-Dec-18 22:07 
AnswerRe: Trying to create a search query that will bring the results searched in access database. It is bringing up an error runtime error '3075' Pin
Richard MacCutchan14-Dec-18 22:51
mveRichard MacCutchan14-Dec-18 22:51 
GeneralRe: Trying to create a search query that will bring the results searched in access database. It is bringing up an error runtime error '3075' Pin
Member 1409033915-Dec-18 5:22
Member 1409033915-Dec-18 5:22 
AnswerRe: Trying to create a search query that will bring the results searched in access database. It is bringing up an error runtime error '3075' Pin
Dave Kreskowiak15-Dec-18 5:16
mveDave Kreskowiak15-Dec-18 5:16 
You're using string concatenation to build the query. This alone is a bad idea as you are very vulnerable to making mistakes and you open the database up to being destroyed due to SQL Injection attacks.

Your code looks like this:
SQL = "SELECT tblVisit.PatientID, tblPatients.Firstname, tblPatients.Lastname" _
        & "DateDiff('yyyy',[tblPatients]![Birthday],Now()) AS Age, tblVisit.[Date Visit]" _
        & "tblVisit.Diagnosis" _
        & "[First Name] &  ' ' & [Last Name] AS [Prescriber Names] FROM tblPatients INNER JOIN (tblDoctor INNER JOIN tblVisit ON tblDoctor.DoctorID = tblVisit.DoctorID) ON tblPatients.PatientID = tblVisit.PatientID" _
        & "WHERE [Firstname] = '" & Me.txtKeywords & "' "

This results in a query string that looks like this. Examine this query statement closely and you're going to find lots of problems. You're missing spaces between words and messed up the concatenation in places.
SELECT tblVisit.PatientID, tblPatients.Firstname, tblPatients.LastnameDateDiff('yyyy',[tblPatients]![Birthday],Now()) AS Age, tblVisit.[Date Visit]tblVisit.Diagnosis[First Name] &  ' ' & [Last Name] AS [Prescriber Names] FROM tblPatients INNER JOIN (tblDoctor INNER JOIN tblVisit ON tblDoctor.DoctorID = tblVisit.DoctorID) ON tblPatients.PatientID = tblVisit.PatientIDWHERE [Firstname] = 'SqlInjectionAttack' "

Now, Google for "SQL Injection Attack" to find out why what you did was so wrong, then Goggle for "VB.NET SQL parameterized queries" to find out what to do about it.

QuestionHow to assign enter key? Pin
Member 1408751912-Dec-18 20:07
Member 1408751912-Dec-18 20:07 
AnswerRe: How to assign enter key? Pin
Richard MacCutchan12-Dec-18 22:00
mveRichard MacCutchan12-Dec-18 22:00 
Questionthe fast ways to create a list Pin
desanti11-Dec-18 4:36
desanti11-Dec-18 4:36 
AnswerRe: the fast ways to create a list Pin
Richard Deeming11-Dec-18 5:30
mveRichard Deeming11-Dec-18 5:30 
GeneralRe: the fast ways to create a list Pin
desanti11-Dec-18 5:40
desanti11-Dec-18 5:40 
GeneralRe: the fast ways to create a list Pin
Eddy Vluggen11-Dec-18 6:39
professionalEddy Vluggen11-Dec-18 6:39 
QuestionFill Treeview using recursion Pin
sterenas7-Dec-18 10:15
sterenas7-Dec-18 10:15 
AnswerRe: Fill Treeview using recursion Pin
Eddy Vluggen8-Dec-18 0:12
professionalEddy Vluggen8-Dec-18 0:12 
AnswerRe: Fill Treeview using recursion Pin
Eddy Vluggen8-Dec-18 1:46
professionalEddy Vluggen8-Dec-18 1:46 
GeneralRe: Fill Treeview using recursion Pin
sterenas8-Dec-18 4:26
sterenas8-Dec-18 4:26 
GeneralRe: Fill Treeview using recursion Pin
Eddy Vluggen8-Dec-18 4:37
professionalEddy Vluggen8-Dec-18 4:37 
GeneralRe: Fill Treeview using recursion Pin
sterenas10-Dec-18 3:52
sterenas10-Dec-18 3:52 
GeneralRe: Fill Treeview using recursion Pin
Eddy Vluggen11-Dec-18 2:08
professionalEddy Vluggen11-Dec-18 2:08 
GeneralRe: Fill Treeview using recursion Pin
sterenas11-Dec-18 5:34
sterenas11-Dec-18 5:34 
GeneralRe: Fill Treeview using recursion Pin
Eddy Vluggen11-Dec-18 6:16
professionalEddy Vluggen11-Dec-18 6:16 
GeneralRe: Fill Treeview using recursion Pin
sterenas11-Dec-18 7:51
sterenas11-Dec-18 7:51 
GeneralRe: Fill Treeview using recursion Pin
Eddy Vluggen11-Dec-18 23:10
professionalEddy Vluggen11-Dec-18 23:10 

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.