俺装了.NET 运平台(2K,IIS,,NET Framework 1.1, .NET Framework SDK 1.1 版),从一本初学书籍上复制了几个简单的源码,但有一个关于ADO.NET 的总求能运,提示:"ADOConnection 类型未声明",似乎不认ADO) 以下是源
<%@ Page Language="vb" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "System.Data.ADO" %>
<html>
<head>
<script runat=server>
Sub Page_Load(ByVal Sender As Object, ByVal e As EventArgs)
On Error Resume Next
Dim cn As ADOConnection
cn = New ADOConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb;")
cn.Open()
If cn.State = 1 Then
lblReturnCode.Text = "The Connection State is: " & cn.State & " - Connection Succeeded"
Else
lblReturnCode.Text = "The Connection State is: " & cn.State & " - Connection Failed"
End If
End Sub
</script>
</head>
<body>
<asp:Label id="lblReturnCode" Runat=server />
</body>
</html>
[此贴子已经被作者于2006-2-25 10:16:05编辑过]