源码是这样的:<%
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={SQL server};server=192.168.0.12;uid=admin;pwd=admin;database=8date" function gdate(ttab,td,tfid2) '取单一数据
if td<>"" then
sql="SELECT "&tfid2&" FROM "&ttab&" WHERE "&td&" ORDER BY ID DESC"
else
sql="SELECT "&tfid2&" FROM "&ttab&" ORDER BY ID DESC"
end if
set drs=Server.CreateObject("ADODB.Recordset")
drs.open sql,conn,1,1
if not drs.eof then
tem=drs(tfid2)&""
gdate=tem
else
gdate=""
end if
drs.close
set drs=nothing
end functionfunction getdate(ttab,td,tfid2) '取多条数据
if td<>"" then
sql="SELECT "&tfid2&" FROM "&ttab&" WHERE "&td&" ORDER BY ID DESC"
else
sql="SELECT "&tfid2&" FROM "&ttab&" ORDER BY ID DESC"
end if
set drs=Server.CreateObject("ADODB.Recordset")
drs.open sql,conn,1,1
if drs.recordcount>0 then
getdate=drs.getrows
end if
drs.close
set drs=nothing
end functionSUB savedate(ttab,tfid,tly) '存储一条数据
marr1=split(tfid,"々")
marr2=split(tly,"々")
if ubound(marr1)=ubound(marr2) then
set rss=Server.CreateObject("Adodb.Recordset")
rss.open ttab,conn,1,3
rss.addnew
for z=0 to ubound(marr1)
if trim(marr2(z))<>"" then rss(marr1(z))=marr2(z)
next
rss.update
rss.close
set rss=nothing
end if
END SUBSUB mdate(ttab,td,tfid2,tly2) '修改单一数据
sql="UPDATE "&ttab&" SET "&tfid2&"='"&cstr(tly2)&"' WHERE "&td
conn.execute(sql)
END SUBSUB madidate(ttab,td,tfid2,tly2) '修改多条数据
marr1=split(tfid2,"々")
marr2=split(tly2,"々")
if ubound(marr1)=ubound(marr2) then
sql="SELECT * FROM "&ttab&" WHERE "&td
set rss=Server.CreateObject("Adodb.Recordset")
rss.open sql,conn,1,3
do while not rss.eof
for z=0 to ubound(marr1)
if trim(marr2(z))<>"" then rss(marr1(z))=marr2(z)
next
rss.update
rss.movenext
loop
rss.close
set rss=nothing
end if
END SUB......
%>不知有什么方法把它做成服务器端 Active Dll
我已经做过几次. 可老是不成功!
不知大家可否帮我做一个把源码发给我或给出一些这方面的资料.非常咸谢谢! EMAIL: [email protected]
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={SQL server};server=192.168.0.12;uid=admin;pwd=admin;database=8date" function gdate(ttab,td,tfid2) '取单一数据
if td<>"" then
sql="SELECT "&tfid2&" FROM "&ttab&" WHERE "&td&" ORDER BY ID DESC"
else
sql="SELECT "&tfid2&" FROM "&ttab&" ORDER BY ID DESC"
end if
set drs=Server.CreateObject("ADODB.Recordset")
drs.open sql,conn,1,1
if not drs.eof then
tem=drs(tfid2)&""
gdate=tem
else
gdate=""
end if
drs.close
set drs=nothing
end functionfunction getdate(ttab,td,tfid2) '取多条数据
if td<>"" then
sql="SELECT "&tfid2&" FROM "&ttab&" WHERE "&td&" ORDER BY ID DESC"
else
sql="SELECT "&tfid2&" FROM "&ttab&" ORDER BY ID DESC"
end if
set drs=Server.CreateObject("ADODB.Recordset")
drs.open sql,conn,1,1
if drs.recordcount>0 then
getdate=drs.getrows
end if
drs.close
set drs=nothing
end functionSUB savedate(ttab,tfid,tly) '存储一条数据
marr1=split(tfid,"々")
marr2=split(tly,"々")
if ubound(marr1)=ubound(marr2) then
set rss=Server.CreateObject("Adodb.Recordset")
rss.open ttab,conn,1,3
rss.addnew
for z=0 to ubound(marr1)
if trim(marr2(z))<>"" then rss(marr1(z))=marr2(z)
next
rss.update
rss.close
set rss=nothing
end if
END SUBSUB mdate(ttab,td,tfid2,tly2) '修改单一数据
sql="UPDATE "&ttab&" SET "&tfid2&"='"&cstr(tly2)&"' WHERE "&td
conn.execute(sql)
END SUBSUB madidate(ttab,td,tfid2,tly2) '修改多条数据
marr1=split(tfid2,"々")
marr2=split(tly2,"々")
if ubound(marr1)=ubound(marr2) then
sql="SELECT * FROM "&ttab&" WHERE "&td
set rss=Server.CreateObject("Adodb.Recordset")
rss.open sql,conn,1,3
do while not rss.eof
for z=0 to ubound(marr1)
if trim(marr2(z))<>"" then rss(marr1(z))=marr2(z)
next
rss.update
rss.movenext
loop
rss.close
set rss=nothing
end if
END SUB......
%>不知有什么方法把它做成服务器端 Active Dll
我已经做过几次. 可老是不成功!
不知大家可否帮我做一个把源码发给我或给出一些这方面的资料.非常咸谢谢! EMAIL: [email protected]
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货