1

当我运行这部分程序时,不断弹出运行时错误 3709。有谁知道我能做些什么来修复它?

Public cn As New ADODB.Connection

Public rs As New ADODB.Recordset

Public CustomerID As Integer

Public CustFirstName As String

Public CustLastName As String


Sub GetCustomerList()

    Dim strSQL As String
    Dim Customers As Variant

    ' Import customer info and use it to populate the list box.
    ' After frmcustomers is unloaded, we will know the CustomerID
    ' and Customer Name of the selected order.

    strSQL = "SELECT CustomerID, CustFirstName, CustLastName FROM Customers"
    rs.Open strSQL, cn

    frmCustomers.Show

    rs.Close
End Sub

谢谢,

杰米

4

5 回答 5

1

解决了,我在使用此代码时收到此错误“3709 未在任何记录中找到搜索键”:

DoCmd.CopyObject , "Data_OldCurrentMemberDetails", acTable, "Data_CurrentMemberDetails"

让我相信我的文件名存在问题,其中包含“[,]”(方括号)。

为避免此类错误,请将您的文件名保留为纯文本,即不要包含“[, ], %, ...”

于 2017-08-10T06:43:37.193 回答
1

尝试编辑一条特定记录时,我得到了相同的错误代码。这是一个常规记录,没有数据或验证不一致。

显然这是一个随机数据损坏问题,我相信这是在使用 MS Access 几年后得到的第一个(仅供统计参考,不是赞成或反对声明!)

通过运行 Compact And Repair 例程解决了问题。

于 2017-04-27T15:04:16.287 回答
0

From the error you are reporting, it would seem that at the point you call GetCustomerList() the connection is not open.

于 2009-11-28T04:25:31.400 回答
0

在数据库中,当您创建包含索引的备注字段或创建包含自动索引文本的字段名称时,它无法写入包含超过 3450 个字符左右的文本字段。当您尝试在字段中写入更多文本或修改现有数据时,收到类似于以下异常 3709 的错误消息

http://support.microsoft.com/kb/302525

于 2012-12-20T18:40:17.947 回答
0

为了完整起见,我在尝试导入列标题中具有前导或尾随空格的 Excel 电子表格时收到错误 3709(在任何记录中均未找到搜索键)。删除它,它就消失了。这是在 Access 2013 中。

于 2015-08-19T16:33:45.623 回答