Downloading an mdb file using INET
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Thread Solved
![]() |
•
•
Posts: 10
Reputation:
Solved Threads: 0
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
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
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 4:15 pm.
•
•
Posts: 10
Reputation:
Solved Threads: 0
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.
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.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Datagrid with Combo Boxes
- Next Thread: Vb4 3077 error
•
•
•
•
Views: 853 | Replies: 10 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode