vendredi 27 février 2015

Missing ), ], or Item in query expression

Not sure why I'm getting this error, I had a look online but couldn't find a solution that worked, any ideas?


I am attempting to search for user's via products, so I enter in a product name and the user's full name and address will be output to a listbox, when I type in a product, however, I get this error:


Missing ), ], or Item in query expression '(((CustomerAccountDetails.custFullName) = 'Red Apple''.


I asked a question previously about the same program which helped a lot with my syntax but I guess I'm still not quite there, I'm still learning SQL so sorry if it is something really simple! :)



Dim searchDatabase As OleDbCommand = New OleDbCommand("SELECT CustomerAccountDetails.custFullName, CustomerAccountDetails.custAddress " _
& "FROM (CustomerAccountDetails " _
& "INNER JOIN CustomerTransaction ON CustomerAccountDetails.ID = CustomerTransaction.custID) " _
& "INNER JOIN (StockDescription " _
& "INNER JOIN TransactionDetails ON StockDescription.ID = TransactionDetails.stockID) ON CustomerTransaction.ID = TransactionDetails.custTransID " _
& "WHERE(((CustomerAccountDetails.custFullName) = '" & productSearch & "'", databaseConnection)


Dim searchResults As OleDbDataReader = searchDatabase.ExecuteReader


Aucun commentaire:

Enregistrer un commentaire