I have a form set up and on that form is a DataGridView, on that DataGridView I would like to display all of a customer's transactions.
I am having a problem where the debugger is throwing me a "Syntax error in JOIN operation." and I can't proceed.
' Select all of the transactions for the currently displayed patron
strSQL = _
" SELECT ITEMS.TITLE, MEDIAS.TYPE, TRANSACTIONS.CHECKOUT, TRANSACTIONS.DUE, TRANSACTIONS.CHECKIN " & _
" FROM TRANSACTIONS, ITEMS, MEDIAS " & _
" INNER JOIN ITEMS ON ITEMS.ID = TRANSACTIONS.ITEM " & _
" INNER JOIN MEDIAS ON MEDIAS.ID = ITEMS.MEDIA " & _
" ORDER BY CHECKOUT "
da = New OleDbDataAdapter(strSQL, cn)
da.Fill(ds, "PatronTransactions")
I have tried revamping the sql code a dozen times and still can't make any more progress on it.
I tried thinning it down to a single join just to test:
SELECT ITEMS.TITLE, TRANSACTIONS.ID
FROM TRANSACTIONS, ITEMS
INNER JOIN ITEMS ON ITEMS.ID = TRANSACTIONS.ITEM
But I still get the same issues.
I checked all the table names and field names and everything is correct, so I am not sure where the issue is coming in.
I've searched thru all the join stuff on the board, but I am still coming up empy handed.
It has to be something simple, or I wouldn't be having so much problem with it.