ASP代码如何根据判断结果对应的两个数据库
asp吧
全部回复
仅看楼主
level 1
忻佑0Iw 楼主
电话号码位数=11 则进shoujihao表 否则 进guhua表
但是着都是写入了CONN数据库中
请问各位大神有办法 dianhuahaoma=11 则进CONN数据库中的shoujihaoma表 否则 进CONN1数据库的guhua表
根据判断信息写入不同的两个数据库吗
Set RS = Server.CreateObject("adodb.recordset")
if int(dianhuahaoma)=int(11) then
SQL = "select * from shoujihao where UserName=*" & strUserName & "*"
else
SQL = "select * from guhua where UserName=*" & strUserName & "*"
end if
RS.Open SQL, CONN, 1, 3
if not RS.Eof then
……
conn.Close
set conn = nothing
2014年09月22日 13点09分 1
level 13
dim m
m="guhua"
if len(dianhuahaoma)=11 then
m ="shoujihao"
end if
SQL="select * from "&m&" where UserName=* * and strUserName = * *"
2014年09月22日 16点09分 2
1