sql问题,请大家帮忙看一下
初学乍练,想提取sql数据库region表的内容,网页中显示源代码,为啥?我用win7 在本机上装的sql2000个人版
系统中建的odbc连接,系统dsn—"localserver",连接测试正常,sql查询分析器也可以登陆数据库
<html>
<head>
<title>exam4-1.asp</title>
</head>
<body>
set objcn = Server.CreateObject("ADODB.CONNECTION")
objcn.open "dsn=localserver;uid=sa;pwd=123;"
sql = "select * from region"
set objrs = objcn.execut(sql)
response.write "<table><tr><td colspan=2>region"</td></tr>"
response.write "<table><tr><td>regionid</td><td>regiondescription</td><tr>"
do while not objrs.eof
response.write "<tr>"
response.write "<td>" & objrs("regionid") & "</td>"
response.write "<td>" & objrs("regiondescription") & "</td></tr>"
loop
objrs.close
objcn.close
set objrs = nothing
-->
</script>
</body>
</html>