本文介绍了SysCmd作为后期绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我这样做: strAccessPath = SysCmd(acSysCmdAccessDir)& msaccess.exe 在vb可执行文件中执行它的样子。 如果删除对访问对象的引用库这个似乎只是应用程序窒息的 行。由于Access Obj库是最可能位于非标准位置的b $ b,我想知道如何在没有它的情况下这样做。 我可以在上面做后期绑定? 实际上,是否可以使所有引用后期绑定? DAO,VB,VBA MS 脚本等 你的,Mike MacSween 解决方案 您可以使用FindExecutable API找出安装Access的位置来自VB的,而不依赖在任何外部库。 FindExecutable中存在一个错误,虽然有较长的名称(在较新的 操作系统中可能存在,也可能不存在),会在第一个空格后截断返回的路径。如果你需要 替代代码与FindExecutable做同样的事情,google for FindExe2。 由于这种方法决定了文件可执行文件的路径 与之关联的扩展,当你在机器上安装了多个 版本的Access时,它可能会变得棘手。 - 删除9以通过电子邮件回复 值得做什么?据推测,像DAO和VB这样的运行时间都是标准的。 我从来没有真正理解所有这些东西。如果在我的开发机器上我 在c:\ myspecialinstallfolderthatonlyiknowabout \ 中有一个库或一个dll而在客户端机器上有相同的库在 c:\ coompletelybogstandardplaceitusuallygoes \会不会一直粉碎应用程序? 或者是VB(在这种情况下)或者是一个智能足以环顾四周的Access应用程序 $ b如果它在第一个地方找不到它,那么就是g。 干杯,Mike MacSween I''m doing this: strAccessPath = SysCmd(acSysCmdAccessDir) & "msaccess.exe" in a vb executable to do what it looks like. If I remove the reference to the access object library this seems to be theonly line the app chokes on. As the Access Obj library is the one mostlikely to be in a non-standard location I''m wondering how to do without it.Can I make that above late binding? In fact, is it possible to make all refs late binding? DAO, VB, VBA MSScripting etc. Yours, Mike MacSween 解决方案 You can use the FindExecutable API to find out where Access is installedfrom VB, without depending on any external library. There is a bug inFindExecutable with long names though (which may or may not exist in newerOSes), that truncates the returned path after the first space. If you needreplacement code that does the same thing as FindExecutable, google forFindExe2. Since this approach determines the path to the executable by a fileextention associated with it, it may get tricky when you have multipleversions of Access installed on the machine. --remove a 9 to reply by email And is it worth doing? Presumably things like DAO and the VB run times allgo in a standard place. I''ve never really understood all this stuff. If on my development machine Ihave a library or a dll in c:\myspecialinstallfolderthatonlyiknowabout\whereas on the clients machine the same library is inc:\completelybogstandardplaceitusuallygoes\ does that always smash the app?Or is VB (in this case) or an Access app smart enough to have a look aroundthe gaff if it doesn''t find it in the first place it looks in. Cheers, Mike MacSween 这篇关于SysCmd作为后期绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-19 04:47