create table(access环境下)自动编号类型的写法
create table(access环境下)自动编号类型的写法
方法一:
create table tablename(id counter constraint primarykey primary key)
需要注意的地方是:第二个primary中间有空格,另外,关键字不区分大小写.
方法二:
create table mytb (id autoincrement(25,1) primary key,age int)
或
create table testtb (id autoincrement,age int,email char, primary key (id))
其中在access中,autoincrement为自动编号类型字段,(25,1)分别为初始值及步长值,如果不写的话,默认是1,1,primary key指定了主键,以上示例,两种指定方法都可以.
相关文档:
OPENDATASOURCE 打开excel、access、qsl
use test
insert into OPENDATASOURCE('SQLOLEDB', 'Data Source=192.168.2.200;User ID=sa;Password=110').test.dbo.adf--打开远程数据库
select * from OpenRowSet('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;HDR=Yes;IMEX=1;Database=c:\2003.xls', [kg$])
--查询远程数据 ......
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: ......
Option Explicit
Private Sub Form_Load()
'工程->引用->选中Microsoft ActiveX Data Objects 2.8 Library
Dim shujukulianjie As New ADODB.Connection
Dim jiluji As New ADODB.Recordset
'连接数据库的代码段
shujukulianjie.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Sour ......
需要注意的是page_load里面的创建存储过程只能执行一次,如果第二次还要创建同名的话会提示错误信息“存储过程已经存在。”,其实加个判断就行了。懒得加了,只是用来试验一下。
调试环境 ASP.NET 2.0(编译工具VS2008),代码C#,access版本2003
protected void Page_Load(object sender, EventArgs e)
{
Ol ......
解决mysql“Access denied for user
我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p p ......