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