I have a SQL Server connected to an Access frontend. Some text fields are set to NVARCHAR(MAX)
and are working fine when I use direct table access to them.
For a query I needeed a LEFT JOIN
to get access to a WHERE
clause on fields of the other table so I created something like this:
strSQL = "SELECT DISTINCT dbo_tbl_Changes.Change_Nr, dbo_tbl_Changes.Title, dbo_tbl_Changes.ChangeContent, dbo_tbl_Changes.Date
FROM dbo_tbl_Changes LEFT JOIN dbo_tbl_Parts ON dbo_tbl_Changes.Change_Nr = dbo_tbl_Parts.Change_Nr
WHERE dbo_tbl_Parts.PartType = 'bolt'
ORDER BY dbo_tbl_Changes.Date DESC "
Forms![frm_ChangeOverview].RecordSource = strSQL
Forms![frm_ChangeOverview].Requery
With this, the NVARCHAR(MAX)
field ChangeContent
is getting cut off and not showing all its content.
If I leave out the DISTINCT
keyword, the NVARCHAR(MAX)
is correctly working within the form in a RichText field.
But then I will get more results than I wawnt (doubled entries) as I need the DISTINCT
keyword in that query to remove those doubled (or even more) results.
One example: The ChangeContent has 1441 characters and is truncated to 157 characters but only when I use the DISTINCT
keyword.
I'm using the native SQL ODBC driver as no other can be installed in my environment.
What could be the issue?