<
%@Import
Namespace
=
System.Data.OleDb%
>
< %@Import Namespace = System.Data% >
< %@PageLanguage = " VB " ContentType = " text/html " ResponseEncoding = " gb2312 " % >
< !DOCTYPEhtml PUBLIC " -//W3C//DTDXHTML1.0Transitional//EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< htmlxmlns = " http://www.w3.org/1999/xhtml " >
< head >
< metahttp - equiv = " Content-Type " content = " text/html;charset=gb2312 " />
< title > 无标题文档 </ title >
< scriptlanguage = " vb " runat = " server " >
Dim conn As OleDb.OleDbConnection
Dim comm As OleDbCommand
Dim rs As OleDb.OleDbdatareader
sub page_load(sender as Object ,e as EventArgs)
conn = New OleDb.OleDbConnection( " Provider=Microsoft.Jet.OLEDB.4.0;DataSource=e: etdbcs.mdb " )
' conn=NewOleDb.OleDbConnection("Provider=Microsoft.ACE.oledb.12.0;Datasource=e: etdbcs.accdb")
conn.open()
comm = New OleDbCommand( " select*fromuserlist " ,conn)
rs = comm.Executereader()
dim showcont as string
do while rs.read()
showcont += rs( " username " ) & " ---- " & rs( " tpnum " ) & " <br/> "
loop
show.innerHTML = showcont
rs.close()
rs = nothing
comm = nothing
conn.close()
conn = nothing
endsub
</ script >
</ head >
< body >
< spanid = " show " runat = " server " />
</ body >
</ html >
< %@Import Namespace = System.Data% >
< %@PageLanguage = " VB " ContentType = " text/html " ResponseEncoding = " gb2312 " % >
< !DOCTYPEhtml PUBLIC " -//W3C//DTDXHTML1.0Transitional//EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< htmlxmlns = " http://www.w3.org/1999/xhtml " >
< head >
< metahttp - equiv = " Content-Type " content = " text/html;charset=gb2312 " />
< title > 无标题文档 </ title >
< scriptlanguage = " vb " runat = " server " >
Dim conn As OleDb.OleDbConnection
Dim comm As OleDbCommand
Dim rs As OleDb.OleDbdatareader
sub page_load(sender as Object ,e as EventArgs)
conn = New OleDb.OleDbConnection( " Provider=Microsoft.Jet.OLEDB.4.0;DataSource=e: etdbcs.mdb " )
' conn=NewOleDb.OleDbConnection("Provider=Microsoft.ACE.oledb.12.0;Datasource=e: etdbcs.accdb")
conn.open()
comm = New OleDbCommand( " select*fromuserlist " ,conn)
rs = comm.Executereader()
dim showcont as string
do while rs.read()
showcont += rs( " username " ) & " ---- " & rs( " tpnum " ) & " <br/> "
loop
show.innerHTML = showcont
rs.close()
rs = nothing
comm = nothing
conn.close()
conn = nothing
endsub
</ script >
</ head >
< body >
< spanid = " show " runat = " server " />
</ body >
</ html >