943,534 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jan 10th, 2009
0

Downloading an mdb file using INET

Expand Post »
The code below downloads the test.mdb file but when I try to open it MS Access says it is in an unrecognised format.

Is it not possible to use Inet for downloading an Access database?

Dim strURL As String
Dim bData() As Byte ' Data variable
Dim intFile As Integer ' FreeFile variable

strURL = "http://www.asite/test.mdb"
intFile = FreeFile()
bData() = Inet1.OpenURL(strURL, icByteArray)
Open App.Path & "\test.mdb" For Binary Access Write As #intFile
Put #intFile, , bData()
Close #intFile
Reputation Points: 10
Solved Threads: 0
Newbie Poster
No Pain No Gain is offline Offline
10 posts
since Jan 2009
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

Are you sure that the database is in the same format (ie, did you make the database in Access 2007, and are opening it in 2003?)
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

Good idea but made in 2000 and trying to open it in 2000
Reputation Points: 10
Solved Threads: 0
Newbie Poster
No Pain No Gain is offline Offline
10 posts
since Jan 2009
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

Mkay, have you tried opening the original (open it with wordpad or notepad, unless it's huge) and then opening the one downloaded through VB, and see if they are the same size and the same basic byte structure etc? And there is no DB on http://www.asite.com for me to check it myself
Last edited by Comatose; Jan 10th, 2009 at 5:15 pm.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

Your previous post made me wonder if the database I was using was corrupt. So I just grabbed another, checked it would open OK, posted it to a website, downloaded it OK, but Access doesn't recognise it.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
No Pain No Gain is offline Offline
10 posts
since Jan 2009
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

weird...are the file sizes the same and all that?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

Just tried open both in Notepad.

Original is gobblydegook

Dowloaded one is bigger and a text file about a missing file
Reputation Points: 10
Solved Threads: 0
Newbie Poster
No Pain No Gain is offline Offline
10 posts
since Jan 2009
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

the gobblydegook is fine, that means it's in access format... if the other opens some kind of weird text, then obviously access won't read it.... now the question is, what is this text about missing files?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

Just posted a simple text file 1.txt with one word in. Changed the app.path to c:\.1.txt

The text file downloads fine and I can open it and see the word. If I alter the two .txt to .mdb and download the database I can still download it but part of what I find in Notepad is this:

"The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.mdb' may be incorrect.   Please review the URL below and make sure that it is spelled correctly."

It seems to be something to do with Access.

I have to go now will let you know tomorrow if I sort it.

Thanks for your help.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
No Pain No Gain is offline Offline
10 posts
since Jan 2009
Jan 10th, 2009
0

Re: Downloading an mdb file using INET

The web server is forbidding the web browser from accessing .mdb files... makes sense for security reasons. On the server, rename the .mdb file to something like "mydatabase.zip" and when you have downloaded the file, have vb rename it to something like "mydatabase.mdb"
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Datagrid with Combo Boxes
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Vb4 3077 error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC