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="Create TABLE [表名]"
二、创建一张有字段的表:
Sql="Create TABLE [表名]([字段名1] MEMO NOT NULL, [字段名2] MEMO, [字段名3] COUNTER NOT NULL, [字段名4] DATETIME, [字段名5] TEXT(200), [字段名6] TEXT(200))
字段类型:
2 : "SmallInt", // 整型
3 : "Int", ......
下面这段C# 代码可以用来压缩和修复Access数据库,不管它是一个简单的".mdb"ACCESS数据库还是一个".mdw"网络共享数据库,这个过程和你在用MS Access应用程序中使用的"工具-数据库实用工具-压缩和修复"时执行的操作完全一样.实例代码使用了"迟绑定"(运行中在内存中建立COM对象),这样就不需要在工程中加入COM引用了,也不需要在P ......
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using Access = Microsoft.Office.Interop.Access;
namespace ImageAccess
{
static class Program
{
......
<?php
$connstr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("data.mdb");
$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC);
$issuetime=date("Y-m-d H:i:s");
$sql="insert into test values("","",...)";
$result=odbc_exec($connid,$sql);
if($result) echo "successful";
else ec ......
asp 中文乱码,asp access 乱码,asp 刷新后乱码,asp utf 8乱码,ajax 乱码 asp,asp 汉字乱码,asp乱码怎么办
用utf-8编码用在新的网站上,不想问题还真多,所以找了些文章,帖子,看了看,等下有用的就贴下面了。
今天,我开始把 CODEPAGE="936" 改成 CODEPAGE="65001"
把charset=gb2312改成 charset=utf-8
可是还是乱码 ......