时间:2021-07-01 10:21:17 帮助过:66人阅读
输出。
dim conn
set conn=server.createobject("adodb.recordset")
conn.open "driver={Microsoft access driver (*.mdb)};dbq=" & server.mappath("data/dd.mdb") 'driver连接方式
'conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("data/dd.mdb") 'provider连接方式
set rs=conn.execute("select * from s_channel where channelID=11")
response.Write rs("UploadSetting")
rs.close
set rs =nothing
如果发现两种连接能正常的
输出内容,但是放到else后面就输出Null什么原因呢?
if IsNull(rs("UploadSetting")) or rs("UploadSetting")="" then
UploadSetting=Split("1,2,3,4@Other@2@0@jpg|gif|bmp|png@100@1@swf@500@1@rm|mp3|wav|mid|avi|mpg|mpeg|asf|wma@2048@1@rar|zip|exe|doc|xls|chm@2048@1","@")
else
UploadSetting=Split(rs("UploadSetting"),"@")
end if
放到if上面可以正常的
输出rs("uploadSetting")中的值,而在Driver方式下则什么也不输出。
dim conn
set conn=server.createobject("adodb.recordset")
conn.open "driver={Microsoft access driver (*.mdb)};dbq=" & server.mappath("data/dd.mdb") 'driver连接方式
'conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("data/dd.mdb") 'provider连接方式
set rs=conn.execute("select * from s_channel where channelID=11")
response.Write rs("UploadSetting")
if IsNull(Rs("UploadSetting")) or rs("UploadSetting")="" then
response.Write "dd"
else
response.Write rs("UploadSetting")
end if
rs.close
set rs =nothing
以上代码,在使用provider方式连接时,能正确