Hi everyone,
I create a simple database wich works great with few users. Recently we needed to move the back-end to MySql and just after this they aks me to allow users to upload file to the database. Moving the db to MySql weren't so difficult (i read a lot of thread). But now in the table "report" I created a blob field (mediumblob field actually, since each file wouldn't exceed 5Mo) and I have a form with select and upload button, and another one to download back the file later, the only thing that missing is the code behind those 2 last buttons. I read many and many of post, as i did to build the app, but didn't find the solution. (I'm on it since sunday, trying many thing out).
I found some code to select and upload file into local table but nothing help me to upload file to MySql back-end and download it back when there is need.
I already have this :
Now i need this :
and :
I post this here and not in a MySql space because I think all the code will be on the access side.
Already thanks to everyone who can help me with this.
I create a simple database wich works great with few users. Recently we needed to move the back-end to MySql and just after this they aks me to allow users to upload file to the database. Moving the db to MySql weren't so difficult (i read a lot of thread). But now in the table "report" I created a blob field (mediumblob field actually, since each file wouldn't exceed 5Mo) and I have a form with select and upload button, and another one to download back the file later, the only thing that missing is the code behind those 2 last buttons. I read many and many of post, as i did to build the app, but didn't find the solution. (I'm on it since sunday, trying many thing out).
I found some code to select and upload file into local table but nothing help me to upload file to MySql back-end and download it back when there is need.
I already have this :
Private sub btnSelect_Click ()
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
With f
With .Filters
.Clear
.Add "", "*.pdf", 1
End With
.InitialFileName = ""
.AllowMultiSelect = False
If f.Show Then
For Each varItem In f.SelectedItems
strFile = Dir(varItem)
strFolder = Left(varItem, Len(varItem) - Len(strFile))
MsgBox "Folder: " & strFolder & vbCrLf & _
"File: " & strFile
Me.filepath.Value = strFolder & strFile
Next
End If
Set f = Nothing
End With
End Sub
Now i need this :
Private sub btnUpload_Click ()
'here the code to upload it
End sub
and :
Private sub btnDownload_Click ()
'here the code to download the file from MySql to local disk (the targer folder could be like "C:\downloads")
End Sub
I post this here and not in a MySql space because I think all the code will be on the access side.
Already thanks to everyone who can help me with this.