我们有一个用Access编写的自定义程序,其中包含奇怪的崩溃.我们添加了错误处理,记录并通过电子邮件发送在我们自己的代码中发生的任何崩溃,这使我们能够修复我们生成的大多数错误,但有时崩溃发生在我们的代码之外.
我们发现在2013年出现新版本的一个示例 - 我们有一个在某个字段中编辑数据后会崩溃的表单 - 新条目很好但创建记录后的任何编辑都会导致完全崩溃关闭MS Access.我们花时间并最终追踪到我们的一些代码迫使表单移动到下一个记录,这个字段是行中的最后一个字段,因此Access本身也试图移动到下一个记录.这是自2007年以来一直在系统中,但在2013年开始导致程序关闭.
有没有办法陷阱和诊断MS访问内的程序级崩溃?
Windows事件查看器仅显示以下内容:
错误的应用程序名称:MSACCESS.EXE,版本:15.0.4454.1501,时间戳:0x50a35ef4错误模块名称:MSACCESS.EXE,版本:15.0.4454.1501,时间戳:0x50a35ef4异常代码:0000005故障偏移:0x00116452出错进程ID:0x1398断裂作用应用程序启动时间:0x01ce6e665043d8be错误应用程序路径:C:\ Program Files文件(x86)的\的Microsoft Office\Office15\MSACCESS.EXE错误模块路径:C:\ Program Files文件(x86)的\的Microsoft Office\Office15\MSACCESS.EXE报告编号: 6cfcb0eb-da62-11e2-8966-842b2b86f028
我正在制作一个简单的演示来学习如何创建一个可绑定的用户控件.我创建了一个简单的类:
class Person
{
public string firstName;
public string lastName;
public Person(string first, string last)
{
firstName = first;
lastName = last;
}
}
Run Code Online (Sandbox Code Playgroud)
而且一个非常简单的用户控件:
<UserControl x:Class="Example.ExampleHRControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<TextBlock x:Name="textFirstName"></TextBlock>
<TextBlock x:Name="textLastName"></TextBlock>
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
我想知道的是,为了能够像普通控件一样在上下文中使用用户控件,我需要做什么.我可以添加到MainWindow:
<local:ExampleHRControl x:Name="Hr1"></local:ExampleHRControl>
Run Code Online (Sandbox Code Playgroud)
然后我可以通过后面的代码解决它并添加值:
Hr1.textFirstName.Text = "John";
Hr1.textLasttName.Text = "Doe";
Run Code Online (Sandbox Code Playgroud)
我希望能够创建类的实例,Person并简单地将主窗口上的控件绑定到Person类.
我需要创建一个查询,查找表中每个唯一项的最低2个值 - 我正在尝试查找每个项的前2个货件.
因此,如果发货表有:
ID ---- Date --- PartID
1 ---- 1/1 ---- 1
2 ---- 1/2 ---- 2
3 ---- 1/2 ---- 1
4 ---- 1/3 ---- 1
Run Code Online (Sandbox Code Playgroud)
我希望返回第1,2和3行,因为它们是每个项目的第一次和第二次发货.
我可以创建一个获得最低2个值的查询:
Select Min(ShipmentID) as SID
from dbo.Shipment
UNION
Select Min(ShipmentID) as SID
from dbo.Shipment
where (ShipmentID >
(Select Min(ShipmentID)
from dbo.Shipment))
Run Code Online (Sandbox Code Playgroud)
但是当我添加其他信息时,我只获得每个项目的最低值,而不是两者:
Select Min(ShipmentID) as SID, AddressIDBilling
from dbo.Shipment
Group by AddressIDBilling
UNION
Select Min(ShipmentID) as SID, AddressIDBilling
from dbo.Shipment
where (ShipmentID >
(Select Min(ShipmentID)
from dbo.Shipment))
Group By AddressIDBilling …Run Code Online (Sandbox Code Playgroud)