使用 msgbox 告诉有多少条记录被插入和更新 [英] use msgbox to tell how many records have been inserted and updated

查看:48
本文介绍了使用 msgbox 告诉有多少条记录被插入和更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 mysql 查询合并到 vba 的消息框中.我想要做的是当用户使用 dgv 将数据发送到数据库时.我怎样才能得到一个消息框来显示有多少记录作为更新进入,多少记录作为插入进入.

How do I incorporate a mysql query into a messagebox in vba. What I want to do is when a user sends data into the database using dgv. How can I get a messagebox to show how many records are going in as updatse and how many are going in as inserts.

仅供参考,我正在使用重复密钥更新功能.

FYI I am using on duplicate key update function.

谢谢

推荐答案

查看一些代码可能会有所帮助,但您只需要设置一个变量来表示要显示的每个元素(比如 nUpdates 和 nInserts).然后在消息框中显示该变量:

It might help to see a little bit of your code, but you just need to set up a variable represent each element you want to display (say nUpdates and nInserts). Then just display that variable in the message box:

MsgBox("Records going in as updates:" & nUpdates & vbNewLine & vbNewLine & _
    "Records going in as inserts:" & nInserts)

这篇关于使用 msgbox 告诉有多少条记录被插入和更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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