In Xs2Ado the function AdoConvertNullStringToNull() is no longer supported. Unfortunately the application I am working on (created in VO with Vo2Ado) uses this function and is quite dependent on it. I think this function makes sure that empty strings are stored as NULL values in the table. Consider this example:
The top 5 ED values should be NULL like in the bottom 3 records which were created with Vo2Ado. Because they are just empty strings with Xs2Ado the query no longer works as it should and unwanted slash characters are added to the title value.
Question: Why was this function removed and what can I do to work around it without having to change every query, which would be an enormous lot of work?
Do you want something like this function which you can use when your insert the data in the sql table?
FUNCTION AdoConvertNullStringToNull(value AS OBJECT) AS OBJECT
RETURN IIF(value == DBNull.Value .OR. value == NULL, "", value)
Hi Jamal,
Thank you for the suggestion but AdoConvertNullStringToNull() is actually a setting; with AdoConvertNullStringToNull(TRUE) NULL_STRINGS will be converted to NULL. The default behaviour is NOT to convert them to NULL.
I see. Until then, have you thought about creating a table trigger or a database wide trigger to save empty strings to NULL?
Myself, I never needed that and I work with SQL Server a lot. I asked the same question to ChatGPT and it provided good answers about both options. If you wish I can post what it suggested here.
I see. Until then, have you thought about creating a table trigger or a database wide trigger to save empty strings to NULL?
Myself, I never needed that and I work with SQL Server a lot. I asked the same question to ChatGPT and it provided good answers about both options. If you wish I can post what it suggested here.
Hi Jamal,
It is an existing application, not written by me, I am converting from VO to X# and it relies on this setting to save empty strings as NULL. Of course I prefer not to make a lot of changes just because this setting has disappeared in the X# version. I am hoping very much that Robert will create a small update that brings back the function @Robert: have you had a chance to look at it?