我对asp相当陌生,我一直在尝试获取一个aspx页面来从数据库中提取数据。但是,我没有显示这些值,而是进入System.__ComObject
了页面。这是我的代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Form to database - showing records</title>
</head>
<body>
<%
Dim connection, recordset, prod, area, number
Dim sSQL, sConnString
prod = Request.Form("product")
area = Request.Form("Area")
sSQL = "SELECT * FROM [" & area & " " & prod & "]"
connection = Server.CreateObject("ADODB.connection")
recordset = Server.CreateObject("ADODB.Recordset")
sConnString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("SPC Data.mdb")
connection.Open(sConnString)
recordset.Open(sSQL, connection)
'Test to see if the code will pull any number at all
number = recordset("Batch ID").ToString
Response.Write("Number =" & number & "<br/>")
recordset.Close
recordset = Nothing
connection.Close
connection = Nothing
%>
</body>
</html>
我已经对这个主题进行了相当多的研究,但还没有找到解决问题的方法。任何帮助将不胜感激