插入日期时间的问题(SQLSERVER 数据库)
str= "insert into testinf(projectname,testpeoplename,teststarttime,projectsavepath,projecttype)values ( ' "+prjname+ " ', ' "+edtTestname-> Text+ " ',Now(), ' "+path+ " ', ' "+type+ " ') ";
ACCESS 数据库没问题
可是SQLSERVER 数据库 报错说 Now() 不是可以识别的函数名
[解决办法]
直接获得当前时间,然后传进入就行了,bcb也有now函数
[解决办法]
String d = Now().DateTimeString();
AnsiString str= "insert into testinf(projectname,testpeoplename,teststarttime,projectsavepath,projecttype)values ( ' "+prjname+ " ', ' "+edtTestname-> Text+ " ', ' " + d + " ', ' "+path+ " ', ' "+type+ " ') ";
[解决办法]
Now()用getdate()代替就可以