【发布时间】:2018-03-02 16:59:28
【问题描述】:
我的 mysql 数据库中有一个函数。 我试图在 VBA 函数中调用我的 VBA 中的 mysql 函数,以通过从表单传递参数来获取结果。 我不知道该怎么做。 这就是我目前所拥有的
function getval(Id As Long) As String
Dim strSQL As String
Dim rsTch As DAO.Recordset
strSQL = "SELECT getname(" & Id & ")"
Set rsTch = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
End Function
但是我收到了这个错误
未定义函数 getname()
getname() 是我的 mysql 函数。不过,当我在 mysql 工作台中运行查询时,我得到了结果。
getval() 是我执行查询的 VBA 函数
id是mysql函数的参数
请帮帮我
【问题讨论】:
-
@TimWilliams 这与连接 mysql 无关。我现在可以执行我的 sql 查询,除了函数
标签: mysql vba ms-access-2013