function readtext(tblnn,seqid,numb,sign)
dim sqltext,ss,perstr as string
dim conn,rs as object
dim percount as integer = 32000 conn=server.createobject("ADODB.Connection")
conn.open (session("tds"),session("tid"),session("tpw")) sqltext="select content from " & tblnn & " where textlist='" & seqid & "' and tabsign='" & sign & "' and textseq='" & numb & "'" rs = conn.execute(sqltext)
ss=""
if rs.eof and rs.bof then
else
do while not rs.eof
ss=""
do while percount>=32000
perstr=rs(0).getchunk(32000)
ss=ss & perstr
'text=text & rs(0).getchunk(32000)
percount=len(perstr)
loop
rs.movenext
' ss=rs(0)
loop
rs.close
end if
conn.close
readtext=ss
end function
我写了个函数从数据库中读出大文本,但是,当库内的大文本是空的时候就读不出来,就报dbnull与string类型不附的错,那么我现在怎么写,判断当为空的时候,把返回的值赋为空串呢?
谢谢拉:)
dim sqltext,ss,perstr as string
dim conn,rs as object
dim percount as integer = 32000 conn=server.createobject("ADODB.Connection")
conn.open (session("tds"),session("tid"),session("tpw")) sqltext="select content from " & tblnn & " where textlist='" & seqid & "' and tabsign='" & sign & "' and textseq='" & numb & "'" rs = conn.execute(sqltext)
ss=""
if rs.eof and rs.bof then
else
do while not rs.eof
ss=""
do while percount>=32000
perstr=rs(0).getchunk(32000)
ss=ss & perstr
'text=text & rs(0).getchunk(32000)
percount=len(perstr)
loop
rs.movenext
' ss=rs(0)
loop
rs.close
end if
conn.close
readtext=ss
end function
我写了个函数从数据库中读出大文本,但是,当库内的大文本是空的时候就读不出来,就报dbnull与string类型不附的错,那么我现在怎么写,判断当为空的时候,把返回的值赋为空串呢?
谢谢拉:)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货