MS Access 2013与Azure后端,无法处理错误 [英] MS Access 2013 with Azure backend, can't handle error

查看:89
本文介绍了MS Access 2013与Azure后端,无法处理错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您阅读,



< span style ="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif; font-size:13.3333px; background-color:#f5f5ff">我在MS中有一个前端Access 2013链接到SharePoint中的SQL。



我在SQL Server中有一个表"tbl_Pipeline"连接到前端并具有读写权限。当创建一个新的
记录时,它运行良好。问题来自于我想要在没有提交记录的情况下退出这个过程。




字段是:

tbl_Pipeline.ID(自动编号)

tbl_Pipeline.date(默认日期())

tbl_Pipeline.Description(简短文字)

tbl_Pipeline.amount(浮动)



如果用户试图离开进程(例如转到上一条记录),则会显示以下信息:



OBDC - 调用失败。

[Microsoft] [SQL Server Native Client 11.0]无法将值NULL插入"描述"列,表'XXXX.tbl_Pipeline';列不允许nulls.INSERT失败。(#515)[Microsoft] [SQL Server Native Client 11.0] [SQL Server]语句已终止。(#3621)。
< br style ="font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;字体大小:13.3333px; background-color:#f5f5ff">


我假设错误正在发生,因为远程表以某种方式接收数据(默认值),然后当用户
离开而没有完成条目时出现NULL错误。




我想在弹出之前捕获错误,以便我可以处理它,但由于它不在MS Access端,我不"看到"
it(错误。计数为零)。




我会很感激所有的建议,因为我已经用尽了我的想法。



谢谢

Leonel



lg

解决方案

你好Lg,


<当您从新记录导航记录时,Access会将当前记录保存到数据库。为了捕获此错误,您可以在Form_Error中处理它,或者我建议您在Form_BeforeUpdate事件中检查该字段是否为空。



这是一个简单的代码:

 Private Sub Form_BeforeUpdate(取消为整数)
'MsgBox" Form_BeforeUpdate"
If IsNull(Me.UP)Then
Me.Undo'这将把当前记录重置为null
取消=真
结束如果
结束子

最好的问候,


爱德华


Thank you for reading,

I have a front-end in MS Access 2013 linked to a SQL in SharePoint.

I have a table "tbl_Pipeline" in SQL Server connected to the front-end with read-write permission. When a new record is created it works well. The problem comes when I want to quit the process without committing the record.

The fields are:
tbl_Pipeline.ID (auto-number)
tbl_Pipeline.date (default date())
tbl_Pipeline.Description (short text)
tbl_Pipeline.amount (floating)

If the user tries to leave the process (e.g. going to a previous record), it displays the following msg:

OBDC--call failed.
[Microsoft][SQL Server Native Client 11.0]Cannot insert the value NULL into column 'Description', table 'XXXX.tbl_Pipeline';column does not allow nulls.INSERT fails.(#515)[Microsoft][SQL Server Native Client 11.0][SQL Server]The statement has been terminated.(#3621).


I assume the errors is happening because the remote table is somehow receiving data (default values), then when the user leaves without completing the entry the NULL error comes up.

I want to catch the error before it pops up so that I can handle it, but since it's not on the MS Access side I don't "see" it (errors.count gives zero).

I'll appreciate all suggestions because I've exhausted my ideas.

Thank you
Leonel


lg

解决方案

Hi Lg,

While you navigate records from new record, Access will save the current records to database. For catching this error, you could handle it in Form_Error or I would suggest you check whether the field is null or not in Form_BeforeUpdate event.

Here is a simple code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
'MsgBox "Form_BeforeUpdate"
If IsNull(Me.UP) Then
    Me.Undo ' this will reset current records to null
    Cancel = True
End If
End Sub

Best Regards,

Edward


这篇关于MS Access 2013与Azure后端,无法处理错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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