
Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
Doug,
I created a new database, brought in the code, and ran it. It created the
Libraries table and put a couple of files in it. I deleted the data in the
table and attempted to call the PackRefs sub routine with PackRefs "text",
"me.txt", "C:", "" and PackRefs "text", "me.txt", "C:\", "". I have a me.txt
file in the root of C:, I was just trying to see if I could get anything to
work. The routine errors out at "ReDim bData(0 To FileSize - 1) As Byte"
with "9 Subscript out of range". Any suggestions?
I'm trying to cut down the code to only what I need to accomplish the
seemingly simple task of reading and writing a file...
Thanks,
Jim
> It's been a while since I've looked at Peter's database, but I thought
> that's what it did: stored the dlls as blobs in the database, and then wrote
[quoted text clipped - 48 lines]
> >> >
> >> > Jim
Douglas J. Steele - 21 Jun 2007 18:29 GMT
What did you pass as strFileName to PackRefs? Was it an existing file?
Put a break point in PackRefs right after the line rst.AddNew. What value is
returned for hFile by the call to CreateFile? What value is returned for
FileSize by the call to GetFileSize?

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Doug,
>
[quoted text clipped - 78 lines]
>> >> >
>> >> > Jim
Jim - 21 Jun 2007 20:15 GMT
Doug,
The call was PackRefs "text", "me.txt", "C:\", ""
strRefName = "text"
strFileName = "me.txt"
strFullPath = "C:\" I also tried it without the "\"
strGUID = "" I also tried it with strGUID = "1"
GENERIC_READ = -2147483648
FILE_SHARE_READ = 1
FILE_SHARE_WRITE = 2
OPEN_EXISTING = 3
hFile returned = -1
FileSize = -1
Hope this helps... Thanks again,
Jim
> What did you pass as strFileName to PackRefs? Was it an existing file?
>
[quoted text clipped - 84 lines]
> >> >> >
> >> >> > Jim
Douglas J. Steele - 21 Jun 2007 20:42 GMT
I believe you need to pass the full path to the file:
PackRefs "text", "me.txt", "C:\me.txt", ""

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Doug,
>
[quoted text clipped - 121 lines]
>> >> >> >
>> >> >> > Jim
Jim - 21 Jun 2007 21:34 GMT
Doug,
That was it, it works. I was able to read in/write out the dlls and run the
application that uses the dlls and it works...
Thanks for your patients,
Jim
> I believe you need to pass the full path to the file:
>
[quoted text clipped - 125 lines]
> >> >> >> >
> >> >> >> > Jim