主题:关于写入sql server 2005的问题
nHandle=GetConnHandle()
IF nHandle>0
=SQLSETPROP(nHandle,"Asynchronous",.F.)
=SQLSETPROP(nHandle,"Transactions",2)
csqlstring="INSERT INTO tblperson"+;
" (员工编号,员工姓名,所属部门,身份证号,银行帐号,代发银行,技术职务,"+;
"行政职务,工资级别,文化程度,出生日期,工作日期) "+;
"values("+transform(thisform.txt1.Value)+",'"+;
ALLTRIM(thisform.txt2.Value)+"','"+ALLTRIM(thisform.txt3.Value)+"','"+;
ALLTRIM(thisform.txt4.Value)+"','"+ALLTRIM(thisform.txt5.Value)+"','"+;
ALLTRIM(thisform.txt6.Value)+"','"+ALLTRIM(thisform.txt7.Value)+"','"+;
ALLTRIM(thisform.txt8.Value)+"',"+TRANSFORM(thisform.txt9.Value)+",'"+;
ALLTRIM(thisform.txt10.Value)+"',"+;
"CONVERT(DATETIME,'"+DTOC(Thisform.txt11.Value)+"',102),"+;
"CONVERT(DATETIME,'"+DTOC(Thisform.txt12.Value)+"',102)"+")"
nResult=SQLEXEC(nHandle,csqlstring)
IF nResult=1
=SQLCOMMIT(nHandle)
WAIT WINDOW "Person Information Succeed!" NOWAIT TIMEOUT 1
ELSE
=SQLROLLBACK(nHandle)
=MESSAGEBOX("Person Information Add Failed!",0+48,"Prompt")
ENDIF
"CONVERT(DATETIME,'"+DTOC(Thisform.txt11.Value)+"',102),"+;
"CONVERT(DATETIME,'"+DTOC(Thisform.txt12.Value)+"',102)"+")"
大家能帮我看一下这段代码的日期时间型怎么改才能执行正确呢?
上面的这代码在VFP开发环境下可以写入sql server 2005但到了编译成exe文件后,就会提示无法写出,请问这是怎么回事呢、
IF nHandle>0
=SQLSETPROP(nHandle,"Asynchronous",.F.)
=SQLSETPROP(nHandle,"Transactions",2)
csqlstring="INSERT INTO tblperson"+;
" (员工编号,员工姓名,所属部门,身份证号,银行帐号,代发银行,技术职务,"+;
"行政职务,工资级别,文化程度,出生日期,工作日期) "+;
"values("+transform(thisform.txt1.Value)+",'"+;
ALLTRIM(thisform.txt2.Value)+"','"+ALLTRIM(thisform.txt3.Value)+"','"+;
ALLTRIM(thisform.txt4.Value)+"','"+ALLTRIM(thisform.txt5.Value)+"','"+;
ALLTRIM(thisform.txt6.Value)+"','"+ALLTRIM(thisform.txt7.Value)+"','"+;
ALLTRIM(thisform.txt8.Value)+"',"+TRANSFORM(thisform.txt9.Value)+",'"+;
ALLTRIM(thisform.txt10.Value)+"',"+;
"CONVERT(DATETIME,'"+DTOC(Thisform.txt11.Value)+"',102),"+;
"CONVERT(DATETIME,'"+DTOC(Thisform.txt12.Value)+"',102)"+")"
nResult=SQLEXEC(nHandle,csqlstring)
IF nResult=1
=SQLCOMMIT(nHandle)
WAIT WINDOW "Person Information Succeed!" NOWAIT TIMEOUT 1
ELSE
=SQLROLLBACK(nHandle)
=MESSAGEBOX("Person Information Add Failed!",0+48,"Prompt")
ENDIF
"CONVERT(DATETIME,'"+DTOC(Thisform.txt11.Value)+"',102),"+;
"CONVERT(DATETIME,'"+DTOC(Thisform.txt12.Value)+"',102)"+")"
大家能帮我看一下这段代码的日期时间型怎么改才能执行正确呢?
上面的这代码在VFP开发环境下可以写入sql server 2005但到了编译成exe文件后,就会提示无法写出,请问这是怎么回事呢、