static void Main(string[] args)
        {
            //环境要求
            //安装 access 2003,
            //引用com组件:Microsoft ADO Ext. 2.8 for DDL and Security
            string connstr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database.mdb;Jet OLEDB:Engine Type=5;";
            ADOX.CatalogClass cat = new ADOX.CatalogClass();
            cat.Create(connstr);
            string sql = @"CREATE TABLE user (
                    Name VARCHAR(50)  ,
                    CtfTp VARCHAR(10) ,
                    CtfId VARCHAR(255) ,
                    Gender VARCHAR(10) ,
                    Address VARCHAR(255) ,
                    Birthday VARCHAR(50) ,
                    Zip VARCHAR(255))";
            using (var connection = new OleDbConnection(connstr))
            {
                connection.Open();
                using (OleDbCommand command = new OleDbCommand(sql, connection))
                {
                    command.ExecuteNonQuery();
                }
            }
        }

 

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
猜你喜欢
  • 2021-12-03
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-10-05
相关资源
相似解决方案