从SQL Server输入文本和ODBC连接 [英] Type text and ODBC connections from SQL Server

查看:77
本文介绍了从SQL Server输入文本和ODBC连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我遇到了一种我无法解释的奇怪行为.

我有以下情况.我的后端数据库是SQL Server.在其中一个表中,我有一个文本类型的字段.我有一个通过ODBC链接到表的Access数据库.该字段的类型为备注.我使用CDaoRecordset从C ++应用程序访问该表.

对于某些记录,无法设置备注/文本"字段的字段值.当我使用函数SetFieldValue(),然后调用函数Update时,从DAO收到一条错误消息(错误代码3197):"Microsoft Jet引擎已停止该过程,因为另一个用户已经编辑了记录集."

对于其他记录,执行完全相同的步骤也没问题.

我确定:
*尚未编辑记录的C ++应用程序
*没有其他用户在做任何事情
*通过导入表仅使用MS Access,不会出现错误
*不管该字段是否为空

在Access(链接表和导入表)和SQL Server中查看记录均未显示任何错误.

任何对正在发生的事情有线索的人吗?

关于

Hi,

I have run in to a strange behaviour that I can''t explain.

I have the following scenario. My back-end database is a SQL Server. In one of the tables I have got a field that is of type text. I have a Access database that links to the table through ODBC. The field get the type Memo. I access the table from a C++ application using CDaoRecordset.

For some records it is not possible to set the field value of the Memo/text field. When I make use of the function SetFieldValue() and then call the function Update I get an error message from DAO (error code 3197) "The Microsoft Jet engine has stoppped the process because another user has edited the record set.".

For other records it is no problem doing the exact same procedure.

I''m certain that:
* the C++ app that hasn''t edited the record
* that there are no other users that is doing anything
* using only MS Access, by importing the table, gives no error
* it is irrespective of if the field is empty or not

Looking at the record within Access (both linked and imported table) and SQL Server doesn''t show any error.

Anyone that has a clue on what is happening?

Regards

推荐答案

检查这些

Microsoft Access数据库引擎停止了该过程,因为您和另一个用户正在尝试同时更改相同的数据. (错误3197) [ ^ ]
使用记录集对象锁定共享数据 [ ^ ]
记录Microsoft Access中的锁定错误 [
Check these

The Microsoft Access database engine stopped the process because you and another user are attempting to change the same data at the same time. (Error 3197)[^]
Locking Shared Data by Using Recordset Objects[^]
Record Locking errors in Microsoft Access[^]


添加thatRaja

确保正确关闭所有连接..

那是

可能是您之前曾打开过连接但从未关闭过,然后又再次打开过连接,在这种情况下,您之前的连接将会失败
Adding with thatRaja

Make sure you closed all the connection properly..

That is

May be you have opened connection before but never closed, then you opened connection again, in this position your previous connection will fail


这篇关于从SQL Server输入文本和ODBC连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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