1.加个ADODC空间
2.这个空间的数据源链接到ACCESS
3. 令 Adodc1.RecordSource =.SELECT * FROM TABLE WHERE 字段=' XX' (TABLE是你的表名,XX是你要查找的内容)
Adodc1.Refresh
if Adodc1.Recordset.RecordCount <1 then
Adodc1.Recordset.new
…………加你要的内容…………
end if
如果是SQL,会用下述语句处理,Access没试过,可能原理也类似
IF NOT EXISTS (SELECT a.name FROM syscolumns a,sysobjects b
WHERE a.id=b.id
AND LTRIM(a.name)='col_name' AND LTRIM(b.name)='tablename')
ALTER TABLE [tablename] ADD [col_name] char(3) NULL
GO