I want to show some data from the AccessUser-tabel in my SQL-database, so I have decided to use the module Database Publishing.
I therefore use Dynamicweb Database as database type and connect to the sql-database and the table. So far so good.
I set my sorting criteria to AccessUserInitials <> 'Null' and choose sorting by the same table. Then I choose the fields that I want, accessuserinitials and accesscustomfield_custom. Finally I select which templates I want to use for this publishment and also deselect any view types, since I only want the rows listed.
The final sql-sentence generated by Dynamicweb is therefore:
select * from [accessuser] t1 where t1.[accessuserinitials] <> 'null' order by t1.[accessuserinitials] asc
This is pretty simple, but yet it gives me the following error:
Warning: Incorrect sql statement
I have also tried different variants, like without the sorting and so on, but no luck. What am I doing wrong?
I also tried with custom SQL where I wrote:
SELECT AccessUserInitials, AccessCustomField_custom
FROM AccessUser
WHERE (AccessUserInitials <> 'NULL')
Order by AccessUserInitials asc
Or in Dynamicweb:
SELECT t1.[accessuserinitials], t1.[accesscustomfield_custom]
FROM [accessuser] t1
where (t1.[accessuserinitials] <> 'NULL')
order by t1.[accessuserinitials] asc
This is actually the sql code from the database itself, where the output was correct. If I use the above in the module, it tells me:
Warning: Fields are not set
Can one not use AccessUser-table for this module or what am I doing wrong? The error-code that I get, doesnt help me much, since there isn't an errorlist, that I can find, to decode these messages and give me suggestions for what to do.