设计一个分页显示数据库记录的ASP程序
1用Access建立数据库文件staff.mdb,包含一个表sta该表有工号,姓名,性别,出生年月,工资等信息,其中工号为主键,注意字段属性的全理性2编写ASP程序,连接...
1 用Access建立数据库文件staff.mdb,包含一个表sta该表有工号,姓名,性别,出生年月,工资等信息,其中工号为主键,注意字段属性的全理性2 编写ASP程序,连接上述数据库,将所有员工的工资增加10%的更新程序(文件名为4pages.asp)我现在考试,小弟在此感谢!
展开
2013-06-29
展开全部
如果你是用VB.net来做,放一个datagrid控件,双击空白处,在最上面打imports system.data.oledbfrom1_load上面打:dim connstr as string="proviede=MIcrosoft.jet.oledb.4.0;data source=f:\数据库的地址\sta.mdb"
Dim myconn As New OleDbConnection(connstr) 在from1_load下面打Dim sqlstr As String
sqlstr = "select * from sta;"
Dim mydp As New OleDbDataAdapter(sqlstr, myconn)
Dim myds As New DataSet
mydp.Fill(myds, "a")
DataGrid1.SetDataBinding(myds, "a") 在button1双击打Dim sqlstr As String
sqlstr = "SELECT 工号,姓名,性别,出生年月,工资 FROM sta where 工资='" & TextBox1.Text * 10% & "'""
Dim mydp As New OleDbDataAdapter(sqlstr, myconn)
Dim myds As New DataSet
mydp.Fill(myds, "a")
DataGrid1.SetDataBinding(myds, "a")
Dim myconn As New OleDbConnection(connstr) 在from1_load下面打Dim sqlstr As String
sqlstr = "select * from sta;"
Dim mydp As New OleDbDataAdapter(sqlstr, myconn)
Dim myds As New DataSet
mydp.Fill(myds, "a")
DataGrid1.SetDataBinding(myds, "a") 在button1双击打Dim sqlstr As String
sqlstr = "SELECT 工号,姓名,性别,出生年月,工资 FROM sta where 工资='" & TextBox1.Text * 10% & "'""
Dim mydp As New OleDbDataAdapter(sqlstr, myconn)
Dim myds As New DataSet
mydp.Fill(myds, "a")
DataGrid1.SetDataBinding(myds, "a")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询