我用一sql语句把数据库中的一个id附值给text1.text,然后我想通过另一个sql语句删除id=text1.text 的数据库记录 以下是sql语句 数据库中id的数据类型为长整型 delete from directory where id= ' & val(trim(text1.text)) & ' 这样写好象不能找到 请问该如何写这个语句呢?
发表于:2008-01-11 01:20:591楼 得分:0
id为数字型字段:
sql code
deletefrom directory where id=& clng(trim(text1.text))
发表于:2008-01-11 08:48:592楼 得分:0
对,要考虑id的数据类型
发表于:2008-01-11 09:23:233楼 得分:0
mark
发表于:2008-01-11 09:32:434楼 得分:0
delete from directory where id= "& trim(text1.text) & "
发表于:2008-01-11 17:25:355楼 得分:0
"delete from directory where id= '" & trim(text1.text)& "'" 1、 如果id的数据库形态为字符串则用我写的,如果为数字形态,则用 "delete from directory where id= " & trim(text1.text)& ""
2、delete后面的form可有可无
发表于:2008-01-11 22:49:506楼 得分:0
id是数字类型的话,sql语句这样写 sql="delete from directory where id=" & 'val(trim(text1.text))'
发表于:2008-01-11 22:51:547楼 得分:0
好像不用单引号,上面写错了 sql="delete from directory where id=" & val(trim(text1.text))
发表于:2008-01-11 22:58:248楼 得分:0
数据型,不用引号:
delete from directory where id=" & val(trim(text1.text)) & "