启
启吾
Unregistered / Unconfirmed
GUEST, unregistred user!
使用者可以在文字输入盒中输入SQL陈述,并会显示所输入的叙述影响资料源的笔数
<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
<Html>
<Form id="F1" Runat="Server">
请输入SQL陈述:<Input Type="Text" Id="Text1" Runat="Server">
<Button ID="Button1" Runat="Server" OnServerClick="Button1_Click">
执行
</Button>
</Form>
<Span ID="Sp1" Runat="Server"/>
<Script Language="VB" Runat="Server">
Sub Button1_Click(sender as object, e as eventargs)
Dim cnA as ADOConnection=New ADOConnection
dim cmA as ADOCommand=New ADOCommand
cnA.Provider="Microsoft.Jet.OLEDB.4.0"
cnA.DataSource="C:/web/MyWeb.mdb"
cnA.UserID="Admin"
cnA.Open()
cmA.ActiveConnection=cnA
cmA.CommandType=Commandtype.Text
cmA.CommandText=Text1.Value
cmA.Execute()
Sp1.InnerText="这个叙述影响了" &
cmA.RecordsAffected &
"笔资料"
End Sub
</Script>
</Html>
但我执行的时候显示编译错误:
编译器错误信息: BC30002: 未定义类型“ADOConnection”。
行 16: Dim cnA as ADOConnection=New ADOConnection
但我已经声明了:<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
望高手指点!
<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
<Html>
<Form id="F1" Runat="Server">
请输入SQL陈述:<Input Type="Text" Id="Text1" Runat="Server">
<Button ID="Button1" Runat="Server" OnServerClick="Button1_Click">
执行
</Button>
</Form>
<Span ID="Sp1" Runat="Server"/>
<Script Language="VB" Runat="Server">
Sub Button1_Click(sender as object, e as eventargs)
Dim cnA as ADOConnection=New ADOConnection
dim cmA as ADOCommand=New ADOCommand
cnA.Provider="Microsoft.Jet.OLEDB.4.0"
cnA.DataSource="C:/web/MyWeb.mdb"
cnA.UserID="Admin"
cnA.Open()
cmA.ActiveConnection=cnA
cmA.CommandType=Commandtype.Text
cmA.CommandText=Text1.Value
cmA.Execute()
Sp1.InnerText="这个叙述影响了" &
cmA.RecordsAffected &
"笔资料"
End Sub
</Script>
</Html>
但我执行的时候显示编译错误:
编译器错误信息: BC30002: 未定义类型“ADOConnection”。
行 16: Dim cnA as ADOConnection=New ADOConnection
但我已经声明了:<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
望高手指点!