HowardMarks
MIS
Dear All
I am currently migrating our intranet from MS Access to SQL Server.
As I understand, SQL Server holds 'true/false' fields as BITs with 1 or 0 value, so I have adapted my code to suit this.
The problem i have is that, in my ASP, testing for '1' against the database value does not return true. Instead I have still have to test for 'true' against the field to get the right result.
e.g. If rs("TS_HOLIDAY") = 1 does not work
whereas If rs("TS_HOLIDAY") = True does work,
even though the field is actually a 1 or a 0.
Can anyone suggest why this might be happening? It's a simple matter to find and replace all =True with =1 etc. for the SQL queries but if i have to still use 'True' when testing against the field in the recordset it becomes a right pain in the backside.
Thanks in advance for your help
Nick (Webmaster)
I am currently migrating our intranet from MS Access to SQL Server.
As I understand, SQL Server holds 'true/false' fields as BITs with 1 or 0 value, so I have adapted my code to suit this.
The problem i have is that, in my ASP, testing for '1' against the database value does not return true. Instead I have still have to test for 'true' against the field to get the right result.
e.g. If rs("TS_HOLIDAY") = 1 does not work
whereas If rs("TS_HOLIDAY") = True does work,
even though the field is actually a 1 or a 0.
Can anyone suggest why this might be happening? It's a simple matter to find and replace all =True with =1 etc. for the SQL queries but if i have to still use 'True' when testing against the field in the recordset it becomes a right pain in the backside.
Thanks in advance for your help
Nick (Webmaster)