数据库连接问题
用字符连接的地方不知道有没有问题!!请高手过目下。。十分感谢!!function getrecordsetwithid(strtablename,intid,intopentype)
dim strsql
strsql="select * from " & strtablename & " where id=" & intid
set getrecordsetwithid=getrecordset(strsql,intopentype)
end function
function isexiststringvalue(srtablename,strfield,strvalue)
dim strsql,rs
strsql="select count(*) as count from" & strtablename & "where" & strfield & "='" & strvalue & "'"
set rs=getrecordset(strsql,0)
if rs("count").value=0 then
isexiststringvalue=false
else
isexiststringvalue=true
end if
set rs=nothing
end function
function isexiststringvaluewithoutid(strtablename,strfield,strvalue,intid)
dim strsql,rs
strsql="select count(*) as count from" & strtablename & "where" & strfield & "='" &strvalue & "'" & "and id<>" & intid
set rs=getrecordset(strsql,0)
if rs("count").value=0 then
isexiststringvaluewithoutid=false
else
isexiststringvaluewithoutid=true
end if
end function
用字符连接的地方不知道有没有问题!!请高手过目下。。十分感谢!!