您的位置:首页 > 数据库

ADODC控件为ACCESS数据库建立新表的一种方法

2010-03-18 10:52 197 查看
1、添加ADODC到窗体

2、ACESS数据库中至少有一张表存在。

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"C:/Documents and Settings/Administrator/" & _
"My Documents/11.mdb;Persist Security Info=False"
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select top 1 * from tb11"
Adodc1.Refresh

With Adodc1.Recordset.ActiveConnection
.Execute = "CREATE TABLE [NT_channel_product3]([Id] counter CONSTRAINT id PRIMARY KEY," & _
"[ChID] long NOT NULL ,title text(100) NOT NULL ,[ClassID] long NOT NULL ," & _
"[SpecialID] text (200) NULL ,[TitleColor] text (10) NULL ," & _
"[TitleITF] byte NULL ,[TitleBTF] byte NULL ,[PicURL] text (200) NULL ," & _
"[Content] memo NULL ,[NaviContent] text (200) NULL ," & _
"[ContentProperty] text (9) NULL ,[Author] text (100) NULL ," & _
"[EdITor] text (50) NULL ,[Souce] text (100) NULL ,[OrderID] byte NOT NULL ," & _
"[Tags] text (100) NULL ,[Templet] text (200) NULL ," & _
"[SavePath] text (200) NULL ,[FileName] text (100) NULL ," & _
"[isDelPoint] byte NOT NULL ,[Gpoint] long NULL ,[iPoint] long NULL ," & _
"[GroupNumber] memo NULL ,[Metakeywords] text (200) NULL ," & _
"[Metadesc] text (200) NULL ,[Click] long NULL ," & _
"[CreatTime] datetime NULL ,[isHTML] byte NOT NULL ," & _
"[isConstr] byte NOT NULL ,[ConstrTF] byte NOT NULL)"
End With
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐