inserir arquivo no access
Galera estou desenvolvendo um sistema de controle de chamados. Bom criei a rotina, mas claro ainda não funciona. Alguém teria uma rotina destas. Basicamente tenho um campo texto e dois botões um localizar e o outro anexar.
1º Clicar no botão localizar
2ª Abrir a API do windos de abrir arquivo.
3º Ao selecionar o arquivo, o campo texto receberá o caminho do arquivo
4º Ao clicar no botão anexar ele salvará esta arquivo em um diretório.
5º Ao Consultar o chamado e ter um arquivo em anexo o nome do arquivo ficará um link, para dowload.
Se alguém tiver alguma referência, agradeço.
jbhelp
<dodigo>
Private Sub Comando45_Click()
On Error Resume Next
Dim k, x, NOME, CAMINHO
x = 0
NOME = ""
For k = Len(Forms!LOCALIZAR!CAMINHO) To 1 Step -1
If Mid(Forms!LOCALIZAR!CAMINHO, k, 1) <> "\" Then
NOME = Mid(Forms!LOCALIZAR!CAMINHO, k, 1) & NOME
Else
GoTo 10
End If
Next
Dim MyStr As String
MyStr = BrowseForFolder(Me.hWnd, _
"LOCAL PARA VINCULAÇÃO")
If Len(MyStr) > 0 Then
If MyStr = "C:\" Then
CAMINHO = MyStr
Else
CAMINHO = MyStr & "\"
End If
End If
DoCmd.TransferDatabase acLink, "Microsoft Access", "Controle_Chamados", acTable
End Sub
Private Sub Comando49_Click()
Dim iNull As Integer
Dim lpIDList As Long
Dim lResult As Long
Dim sPath As String
With udtBI
.hWndOwner = hWndOwner
.ulFlags = BIF_RETURNONLYFSDIRS
End With
lpIDList = SHBrowseForFolder(udtBI)
If lpIDList Then
sPath = String$(MAX_PATH, 0)
lResult = SHGetPathFromIDList(lpIDList, sPath)
Call CoTaskMemFree(lpIDList)
iNull = InStr(sPath, vbNullChar)
If iNull Then
sPath = Left$(sPath, iNull - 1)
End If
End If
BrowseForFolder = sPath
End Function
End Sub
</codigo>
Discussão (5)
Carregando comentários...