为什么 VB6 MkDir 命令在其他机器上抛出错误 75 而在我的机器上却没有?

发布于 2024-11-01 23:41:06 字数 655 浏览 0 评论 0原文

我的 VB6 程序在首先确认文件夹不存在后使用 Mkdir 创建一个文件夹,使用这个再简单不过的代码:

If LenB(Dir$(ImportFolder & "\" & UuidPartOfImportFolderName, vbDirectory)) = 0 Then
  MkDir ImportFolder & "\" & sIECommon2.gstrUniqueImportUuid
End If

当我在自己的开发环境中从 IDE 内部运行此代码时,甚至运行当我在本地计算机上运行 .exe 时,它​​运行得很好——文件夹按预期创建,然后在其中成功创建了其他文件。

但是,当我构建可执行文件并将其安装在另一台计算机上时,Mkdir 命令会抛出错误“错误 75:路径/文件访问错误”。 (我通过在该命令的前后放置一个 MsgBox 命令来缩小范围——前面的命令会显示,但后面的命令不会显示。)

根据 Mkdir 创建的文件夹的默认权限,每个人都是 rwx。我的研究......那么为什么它会在其他机器上抛出错误而不是在我的机器上?

或者也许它与它运行在什么机器上无关——我只是没有其他理论。另一个奇怪的事情是这个程序多年来一直在其他地方使用 MkDir ;我刚刚在添加附加功能时添加了这个新功能。

谢谢您——期待您的回复。

My VB6 program uses Mkdir to create a folder after first confirming that the folder doesn't exist, using this couldn't-be-simpler code:

If LenB(Dir$(ImportFolder & "\" & UuidPartOfImportFolderName, vbDirectory)) = 0 Then
  MkDir ImportFolder & "\" & sIECommon2.gstrUniqueImportUuid
End If

When I run this code in my own development environment, from inside the IDE, or even run the .exe on my local machine, it works perfectly--the folder gets created as expected and other files are then successfully created in it.

But when I build the executable and install it on another machine, the Mkdir command throws the error 'Error 75: Path/File Access error'. (I narrowed it down to this command by putting a MsgBox command immediately before and after it--the one before gets displayed, but the one after does not.)

The default permissions on a folder created using Mkdir are rwx for everyone, according to my research ...so why would it throw the error on other machines and not on mine?

Or maybe it has nothing to do with what machine it's running on--I just had no other theories. The other weird thing is that this program has used MkDir in other places for years; I've just added this new one when I added additional functionality.

Thank you--looking forward to your responses.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许久 2024-11-08 23:41:07

我怀疑 WQW 的答案就是正在发生的事情,但是,您可能想验证两台机器是否运行相同版本的 VB6 运行时 (MSVBVM6.dll)。有几个版本。虽然可能性不大,但一个人的行为可能与另一个人略有不同。

但我再次怀疑,我怀疑您正在使用的两个文件夹名称并不完全相同。

I suspect that WQW's answer is what's happening, but, you might want to verify that the two machines are running the same version of teh VB6 runtimes (MSVBVM6.dll). There are several versions. It's a long shot but one might behave slightly differently than another.

But again, I kind of doubt that, I suspect the two folder names you're working with aren't exactly the same.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文