【发布时间】:2017-08-24 14:08:11
【问题描述】:
所以我在 python 中使用 pyodbc 库来访问我的 Microsoft Access 数据库,并且只是尝试在我创建的字段中插入数据,其中一个字段是附件类型列。因此,我试图找到一种通过 python 将附件插入我的 accdb 的方法。
这是我的代码,我已成功连接到我的数据库。 这就是我用来尝试插入文本和附件的方法;我把它作为一个用分号分隔的组合字符串,因为如果我选择并打印附件列中的值,我会得到输出: My Code for setting up a connection, getting the info from a database if it exists, and trying to insert both textual data and attachment data to a database
但是,运行后,我收到此错误并且没有填充任何字段:Error generated for Insert
所以我的问题是:如何使用 python 中的 pyodbc 库将附件成功上传到我的 Access 数据库?
【问题讨论】: