更新访问数据库 [英] update an access database

查看:72
本文介绍了更新访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我正在做一个数据库项目,我想更新一个访问数据库.
我使用此sql命令连接了数据库
''select*from word''
我尝试使用此代码更新数据库

Hi guys!I''m currently making a database project and I want to update an access database.
I connected the database using this sql command
''select*from word''
And I tryied to update the database using this code

ds.tables('word').rows(0).item(1)="cat"
Dim cb as new oledb.oledbcommandbuilder(da)
da.update(ds,"word")


da是数据适配器
ds是一个数据集
我的问题是运行时出现错误.
有什么想法吗?
-致谢

更新:
这是错误消息.
针对不返回任何键列信息的选择命令,不支持为更新命令生成动态SQL"
您可以帮我吗?


da is a data adapter
ds is a data set
My problem is it giving me an error in runtime.
Any ideas?
-Regards

Update:
Here is the error message.
"Dynamic Sql generation for the update command is not supported against a select command that does not return any key column information"
Can u help me?

推荐答案

似乎您的数据库表未定义主键.在表上设置一个主键,然后重试.
操作方法如下:创建或修改主键-访问权限 [ ^ ]
It seems your database table has no Primary Key defined. Set a Primary Key on your table and try again.
Here''s how: Create or modify a primary key - Access[^]


这篇关于更新访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆