Access 的分页功能
if (currentPage ==1) {
//如果当前页为第1页
sql ="select top "+pageSize+" * from Table";
} else {
int start =(currentPage -1)*pageSize;
sql ="select top "+pageSize+" * from Table where ID not in (select top "+start+" ID from Table)";
}
相关文档:
SQLConfigDataSource
创建ODBC数据源可以调用Windows系统子目
录下的动态链接库Odbcint.dll中的函数SQLConfigDataSource()
该函数可以动态地增加、修改和删除
数据源。
SQLConfigDataSource()函数
SQLConfigDataSource()的原型如下:
BOOL SQLConfigDataSource(HWND hwndParent, UINT
fRequest ......
后台数据库:
[Microsoft Access]
与
[Microsoft Sql Server]
更换之后,ASP代码应注意要修改的一些地方:
[一]连接问题(举例)
[Microsoft Access]
constr = "DBQ=c:\data\clwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"
[Microsoft Sql Server]
constr = "DRIVER={SQL Server};SERVER=host;DATA ......
//根据主键来删除表中的数据。
//删除
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
OleDbConnection sqlConnection = new OleDbConnection(GetConnection());
& ......
更新方法一,直接在GridView中来更新数据.
更新方法二,打开一个新的页面来更新数据.
//更新
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
&nbs ......