| | |
Downloading an mdb file using INET
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jan 2009
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 5:15 pm.
•
•
Join Date: Jan 2009
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
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






