Link to this article:Http://user.qzone.qq.com/150042092/blog/1191940031
STR = "provider = Microsoft. Jet. oledb.4.0; Data Source =" & server. mappath ("Kong. mdb ")
'Str = "driver = {Microsoft Access Driver (*. mdb)}; DBQ =" & server. mappath ("Kong. mdb ")
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open Str
Create an access table or add fields
SQL = "CREATE TABLE mytb (ID autoincrement primary key, text type varchar (10) default HBH, long integer int default 123, integer
Smallint, remarks memo, remarks 2 Note, date default now (), whether yesno )"
Example:
Create Table myta and fields
SQL = "CREATE TABLE mytb (ID autoincrement primary key, name varchar (8), age smallint,ArticleNote, date default now ())"
Add a field to the myta table.
SQL = "ALTER TABLE mytb add column address varchar (200 )"
Modify Field
SQL = "ALTER TABLE mytb alter column address note"
Delete Field
SQL = "ALTER TABLE mytb drop address"
Delete table
SQL = "Drop table mytb"
Conn.exe cute (SQL)