使用 OLEDB 连接的 MS ACCESS 2003 中的分组对象错误
我有一个 MS ACCESS 2003 数据库,其中有一个表“TABLEA”。
然后我使用 OLEDB 连接并创建一个表,然后以编程方式填充数据,如下所示:
string create_table_script = @" CREATE TABLE [" + Path.GetFileNameWithoutExtension(filename) + @"](
[AutoID] COUNTER PRIMARY KEY ,
[CAS] text(255) ,
[Listed French Ingredient No] text(255) ,
[Name] text(255) ,
[GC] text(20) ,
[Grp_Code] text(10) ,
[Galsyn] Memo ,
[Notes LCN] text(255) ,
[Notes LFIN] text(255) ,
[%w/w] text(255) )";
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + fullpath + ";" + " User Id=admin; Password=";
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbCommand SelectCommand = new OleDbCommand(create_table_script, connection);
connection.Open();
try
{
SelectCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
Console.WriteLine(ex.Message);
}
finally
{
connection.Close();
}
}
填充此表后,
每当我打开此访问数据库时,我只会收到此消息一次
“31613 您已选择“表和相关视图”作为分组方式数据库中的对象。Access 需要更新有关对象依赖性的信息来创建组,这对于大型数据库来说需要一些时间。是否继续?”
我不知道我错在哪里。我为此目瞪口呆,但没有得到任何好处。 我认为创建表中有一些问题
任何帮助都是值得赞赏的。
I have a MS ACCESS 2003 datatbase that have one table in it "TABLEA".
Then I use OLEDB connection and create a table and then fill the data programatically as:
string create_table_script = @" CREATE TABLE [" + Path.GetFileNameWithoutExtension(filename) + @"](
[AutoID] COUNTER PRIMARY KEY ,
[CAS] text(255) ,
[Listed French Ingredient No] text(255) ,
[Name] text(255) ,
[GC] text(20) ,
[Grp_Code] text(10) ,
[Galsyn] Memo ,
[Notes LCN] text(255) ,
[Notes LFIN] text(255) ,
[%w/w] text(255) )";
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + fullpath + ";" + " User Id=admin; Password=";
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbCommand SelectCommand = new OleDbCommand(create_table_script, connection);
connection.Open();
try
{
SelectCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
Console.WriteLine(ex.Message);
}
finally
{
connection.Close();
}
}
After filling this table,
I get this message only once whenever i open this access datatbase
"31613 You have selected "Tables and Related Views" as the way to group objects in the database. Access needs to update information on object dependencies to create the groups. This will take some time for large databases.Do you want to continue?"
I don't know where i am wrong. I goggled it for this but does not get any benefit.
I think there is some thing wrong in create table
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是使用 C# 代码创建 MS Access 表的最佳方法。
This is the Best Way to Create Table of MS Access using C# code.
这是有关“导航窗格(快门栏)”中导航的访问问题,与您创建表的方式无关。您可以安全地忽略此问题,因为它是特定于 Access 的且与 OleDb 无关
This is an Access issue regarding navigation in the "Navigation Pane (Shutter Bar)" and has nothing to do with the way you are creating the table. You can safely ignore this issue because it is Access specific and not related to OleDb