我试图为SQL Server中的数据传递Null值,但我一直得到'1900-01-01'的值
strSQL = "INSERT INTO Table (Data_Col) VALUES ('Null')"
如何获得Null值而不是此值'1900-01-01'?
编辑:这会出错
strSQL = "INSERT INTO Ex_Tbl (Data_1, Data_2, Date_1, Date_2, Data_3) VALUES (1,2,'2015-3-2',,30)"
但事实并非如此
strSQL = "INSERT INTO Ex_Tbl (Data_1, Data_2, Date_1, Date_2, Data_3) VALUES (1,2,'2015-3-2','',30)"
编辑No.2我是否需要使字符串看起来像这样.
strSQL = "INSERT INTO Ex_Tbl (Data_1, Data_2, Date_1, Date_2, Data_3) VALUES (1,2,'2015-3-2',Null,30)"
如果是这样,我将需要这样的代码正确,
strSQL = "INSERT INTO Ex_Tbl (Data_1, Data_2, Date_1, Date_2, Data_3) VALUES (1,2,'2015-3-2'," & "Null" & ",30)"
Matt.. 5
尝试 strSQL = "INSERT INTO Table (Data_Col) VALUES (NULL)"
引号中的空值计数字符串=无效的日期格式=更改为1900-01-01.
尝试 strSQL = "INSERT INTO Table (Data_Col) VALUES (NULL)"
引号中的空值计数字符串=无效的日期格式=更改为1900-01-01.