Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Excel 2007 中的连接字符串连接到 SQL Server 2005。我想为无法访问我们数据库的客户提供相同的 excel。现在是否可以显示有意义的消息并能够保留数据?我已经在命令按钮单击上编写了代码。
是的,这是可能的。尝试使用这样的东西
On Error Goto ErrHandler ---Your Connection Code Here ---- ErrHandler: MsgBox "Cannot Establish Connection.", vbExclamation