易截截图软件、单文件、免安装、纯绿色、仅160KB

Access数据操作Update方法

using System.Data.OleDb; //这里要引用OleDb空间
public partial class addInfo : System.Web.UI.Page
{
    //数据库连接字符串
    static string strCon = @"provider = Microsoft.Jet.OLEDB.4.0;Data source = |DataDirectory|gyMDB.mdb";
    //以上方法为连接ACCESS 特定数据目录APP_DATA 下数据文件的方法。注意DATADIRECTORY 的使用。
    //申明连接数据源的对象和对数据源进行操作的对象
    OleDbConnection con = new OleDbConnection(strCon);
    OleDbCommand cmd = new OleDbCommand();
    //点击按钮添加记录
    protected void Page_Load(object sender, EventArgs e)
    {
        TextBox11.ReadOnly = false;
        TextBox11.Text = "这是学号";
        TextBox11.ReadOnly = true;
        TextBox12.Text = "这是准考证号";
        TextBox13.Text = "这是姓名";
        if (!Page.IsPostBack) { }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
      
        string A0 = TextBox11.Text; //0.学号
        string A1 = TextBox12.Text; //1.准考证号
        string A2 = TextBox13.Text; //2.姓名
        string A3 = DropDownList1.Text; //3.小学入学年月
        string A4 = DropDownList2.Text; //4.班号
        string A5 = DropDownList3.Text; //5.学生类别
        string A6 = TextBox1.Text.Trim(); //6.身份证号
        string A7 = DropDownList4.Text; //7.性别
  


相关文档:

Sql Server 和 Access 操作数据库结构Sql语句

新建表:
create table [表名]
(
[自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,
[字段1] nVarChar(50) default '默认值' null ,
[字段2] ntext null ,
[字段3] datetime,
[字段4] money null ,
[字段5] int default 0,
[字段6] Decimal (12,4) default 0,
[字段7] image null ,
)
删除表:
Drop table [表 ......

关于update语句在sqlserver和Access中的对比

sqlserver:update Table_A set Table_A.col1 = (select Table_B.col1 from Table_B where Table_A.col2 = Table_B.col2)
Access: UPDATE Table_ A, Table_B SET Table_ A.字段2 = Table_ B.字段2
WHERE Table_ A.编号=Table_ A.编号;
自己记下,提醒自己 ......

ACCESS的模糊查询

在SQL Server中模糊查询通常是这样的Select * from articleTable where authorName like '%jacky%'
但是在Access中用这条语句执行的时候竟然发现查不出结果,怎么可能呢?
后来查了下资料,发现问题如下:
要进行模糊查找,则必须使用通配符,ACCESS库的通配符和SQL SERVER的通配符不一样。
ACCESS库的通配符为:
*& ......

asp连接access数据例子

<%Dim connstrconnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Stu.mdb")
Set bb = Server.CreateObject("ADODB.Connection")
bb.Open connstr%>
<html>
<head>
<meta http-equiv="content-Language" content="zh-cn" />
<meta http-equiv="Content-Type ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号