Connecting Tech Pros Worldwide Forums | Help | Site Map

Unzip a file

Mark
Guest
 
Posts: n/a
#1: Jul 10 '07
Good evening all,
using a XP pro platform and Access 2003 SP2, is it possible to identify
a .zip file, inflate the file and then import the contents? I'm pretty
certain I could code steps 1 & 3 but over an hour of googling, I haven't
found anything which has been of any help.

Thanks in advance,

Mark



Chris L.
Guest
 
Posts: n/a
#2: Jul 10 '07

re: Unzip a file


On Jul 10, 4:03 pm, "Mark" <mreed1...@ntlworld.comwrote:
Quote:
Good evening all,
using a XP pro platform and Access 2003 SP2, is it possible to identify
a .zip file, inflate the file and then import the contents? I'm pretty
certain I could code steps 1 & 3 but over an hour of googling, I haven't
found anything which has been of any help.
>
Thanks in advance,
>
Mark
Please see if this helps

http://groups.google.com/group/micro...6f06d859a21886

AFAICS involves using VBS to invoke OS command "compact" with command
line switches to uncompress a given file.


Mark
Guest
 
Posts: n/a
#3: Jul 11 '07

re: Unzip a file


Hi Chris,
apologies again for not being clear in my original post. The link you
have sent worked as you stated but instead of compressing a file by setting
it's advanced properties to "Compress contents to save disc space" = TRUE, I
want to be able to extract the contents of a .zip file which this code does
not do :o(

Many thanks,

Mark


"Chris L." <diversos@uol.com.arwrote in message
news:1184100107.768038.319450@o61g2000hsh.googlegr oups.com...
Quote:
On Jul 10, 4:03 pm, "Mark" <mreed1...@ntlworld.comwrote:
Quote:
>Good evening all,
> using a XP pro platform and Access 2003 SP2, is it possible to
>identify
>a .zip file, inflate the file and then import the contents? I'm pretty
>certain I could code steps 1 & 3 but over an hour of googling, I haven't
>found anything which has been of any help.
>>
>Thanks in advance,
>>
>Mark
>
Please see if this helps
>
http://groups.google.com/group/micro...6f06d859a21886
>
AFAICS involves using VBS to invoke OS command "compact" with command
line switches to uncompress a given file.
>
>

Chris L.
Guest
 
Posts: n/a
#4: Jul 11 '07

re: Unzip a file


Mark: You looked at the first piece of code only... scroll down and
you'll find the uncompressing code. (I'll paste it again here)


=== paste begin

dim fso, strFile
strFile = "d:\tempp\test.txt"


set fso=createObject("Scripting.fileSystemObject")
set wshShell = createObject("Wscript.Shell")
set fl = fso.getFile(strFile)
if (fl.attributes AND 2048) then
strCompactCmd = "%comspec% /c compact /u """ & strFile &
""""
wscript.echo "Trying to uncompress...using command:" &
strCompactCmd
set objOut = wshShell.exec(strCompactCmd)
while objOut.status=0
wscript.sleep 1000
wend
strOP=objOut.StdOut.ReadAll()
if instr(1,strOP,"[OK]") = 0 then
wscript.echo "Error uncompressing file: " & strFile
'wscript.echo strOP
else
wscript.echo "File: " & strFile & " uncompressed
successfully"
end if
else
wscript.echo "File is not compressed, aborting uncompress
operation."
end if

=== paste end

Regards
Chris


On Jul 10, 8:29 pm, "Mark" <mreed1...@ntlworld.comwrote:
Quote:
Hi Chris,
apologies again for not being clear in my original post. The link you
have sent worked as you stated but instead of compressing a file by setting
it's advanced properties to "Compress contents to save disc space" = TRUE, I
want to be able to extract the contents of a .zip file which this code does
not do :o(
>
Many thanks,
>
Mark
>
"Chris L." <diver...@uol.com.arwrote in message
>
news:1184100107.768038.319450@o61g2000hsh.googlegr oups.com...
>
>
>
Quote:
On Jul 10, 4:03 pm, "Mark" <mreed1...@ntlworld.comwrote:
Quote:
Good evening all,
using a XP pro platform and Access 2003 SP2, is it possible to
identify
a .zip file, inflate the file and then import the contents? I'm pretty
certain I could code steps 1 & 3 but over an hour of googling, I haven't
found anything which has been of any help.
>
Quote:
Quote:
Thanks in advance,
>
Quote:
Quote:
Mark
>
Quote:
Please see if this helps
>>
Quote:
AFAICS involves using VBS to invoke OS command "compact" with command
line switches to uncompress a given file.- Hide quoted text -
>
- Show quoted text -

John Marshall, MVP
Guest
 
Posts: n/a
#5: Jul 14 '07

re: Unzip a file


Still plagarizing? You should give the original author credit..

John... Visio MVP

"Steve" <sorry@private.emailaddresswrote in message
news:5qRki.5762$rR.335@newsread2.news.pas.earthlin k.net...
Quote:
>I copied the below from somewhere in the past. Hope it helps!
>

Tony Toews [MVP]
Guest
 
Posts: n/a
#6: Jul 16 '07

re: Unzip a file


"Mark" <mreed1975@ntlworld.comwrote:
Quote:
using a XP pro platform and Access 2003 SP2, is it possible to identify
>a .zip file, inflate the file and then import the contents?
Compression DLLs, OCXs, etc
http://www.granite.ab.ca/access/compression.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Mark
Guest
 
Posts: n/a
#7: Jul 24 '07

re: Unzip a file


Absolutley fantastic. Thank you very much Tony.

This has been driving me mad for weeks now :o)

Regards,

Mark


"Tony Toews [MVP]" <ttoews@telusplanet.netwrote in message
news:7kqn93dig8q441jk9ls8aver8s4tfi1035@4ax.com...
Quote:
"Mark" <mreed1975@ntlworld.comwrote:
>
Quote:
> using a XP pro platform and Access 2003 SP2, is it possible to
>identify
>>a .zip file, inflate the file and then import the contents?
>
Compression DLLs, OCXs, etc
http://www.granite.ab.ca/access/compression.htm
>
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

Tony Toews [MVP]
Guest
 
Posts: n/a
#8: Jul 27 '07

re: Unzip a file


"Mark" <mreed1975@ntlworld.comwrote:
Quote:
Quote:
Quote:
>> using a XP pro platform and Access 2003 SP2, is it possible to
>>identify
>>>a .zip file, inflate the file and then import the contents?
>>
>Compression DLLs, OCXs, etc
>http://www.granite.ab.ca/access/compression.htm
Quote:
>Absolutley fantastic. Thank you very much Tony.
>
>This has been driving me mad for weeks now :o)
You are quite welcome. Glad my website was of assistance.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Closed Thread


Similar Microsoft Access / VBA bytes