我需要帮助我在连接到经典 asp 中的数据库时得到一个恒定的空白页。出于安全目的,我更改了一些连接字符串。我知道这个字符串有效,因为我可以在 vb.net 中连接到它。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search Test</title>
</head>
<body>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Data Source=ServerIP;Initial Catalog=Database;User ID=Username;Password=Password"
strSql = "SELECT * FROM categories Where idParentcategory=1 ORDER BY categorydesc ASC"
Set rs = Conn.Execute(strSql)
If rs.eof Then
Response.write("No records returned")
End If
do until rs.eof
Response.write(rs("categorydesc") & "<br>")
rs.movenext
loop
Conn.Close
Set Conn = Nothing
%>
</body>
</html>