todo todo??? ok
Private Sub Command1_Click()
'botón para seleccionar fichero a subir al Ftp
With CommonDialog1
.DialogTitle = " Seleccione el archivo a subir"
.ShowOpen
If .FileName = "" Then
txtImagen = ""
Exit Sub
Else
txtImagen = .FileName
End If
End With
End Sub
Private Sub Form_Load()
menu.Theme = 2
menu.ImageList = ImageList1
menu.ImageList2 = ImageList2
menu.ButtonCenter = True
menu.AddTab "1", "Catálogo de Plazas"
menu.AddCat "1", "1", "Acciones", False
menu.AddCat "2", "1", "Exportar", False
llenaBarra menu, True, False, False, False, False, True, True, True, True, True
Call gridBaner
Command1.Caption = "Subir archivo "
txtUrl.enabled = False
txtTitulo.enabled = False
txtImagen.enabled = False
'txtSeccion.enabled = False
gridBusqueda.enabled = True
Command1.enabled = False
' Label1.Caption = Now ' Fecha y hora
lblFecha.Caption = date ' Fecha
lbl_Hora.Caption = Time ' Hora
End Sub
Private Sub gridBaner()
SQL = "select Id_blabla,File,Url,Section from blabla_blibli where BanEliminar=0"
llenarGrid gridBusqueda, SQL, "2000-8000-800-800"
End Sub
Sub Limpiar()
txtTitulo.Text = Clear
txtUrl.Text = Clear
txtImagen.Text = Clear
'txtSeccion.Text = Clear
txtImagen.SetFocus
End Sub
Private Sub gridBusqueda_Click()
If (Me.id.Caption = "0" Or Me.id.Caption = "") Then
If gridBusqueda.TextMatrix(gridBusqueda.Row, 0) <> "0" Then
llenaBarra menu, True, False, False, True, True, True, True, True, True, True
End If
End If
id.Caption = CLng(gridBusqueda.TextMatrix(gridBusqueda.Row, 0))
End Sub
Private Sub Id_Change()
SQL = "select Id_blabla,File,Url,Section from blabla_blibli where Id_blabla = " & Me.id.Caption & ""
Set Record = Ejecutar(SQL)
If Not Record.EOF = True Then
txtUrl.Text = Record.Fields("Url")
txtTitulo.Text = Record.Fields("Section")
'txtSeccion.Text = Record.Fields("Section")
txtImagen.Text = Record.Fields("File")
End If
End Sub
Function UploadFile(ByVal HostName As String, ByVal UserName As String, ByVal Password As String, ByVal LocalFileName As String, ByVal RemoteFileName As String) As Boolean
Dim FTP As Inet1
Set FTP = New Inet1
With FTP
.URL = "ftp://...."
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "put " + LocalFileName + " " + RemoteFileName
Do While .StillExecuting
DoEvents
Loop
Dim texto As String
UploadFile = (.ResponseCode = 0)
.Execute , "quit"
Logoff
End With
Set FTP = Nothing
End Function
Private Sub menu_ButtonClick(ByVal id As String, ByVal Caption As String)
Select Case Caption
Case "Nuevo":
txtImagen.enabled = True
txtTitulo.enabled = True
txtUrl.enabled = True
'txtSeccion.enabled = True
gridBusqueda.enabled = False
llenaBarra menu, False, True, True, False, False, False, False, False, False, False
Command1.enabled = True
Case "Guardar":
a = UploadFile("ftp://
[email protected]/blabla/", "blablas", "pwjr", "c:\txtImagen.Text", "/no.no.no.no/blabla/txtImagen.Text")
', "/public_html/uploadFileByBasic6/"
If a Then
MsgBox "Archivo subido"
Else
MsgBox "No se ha podido subir"
End If
If hayCamposVacios(Me, 1) = True Then Exit Sub
SQL = "insert into blabla_blibli(File,Url,Section)value('" & txtImagen.Text & "','" & txtUrl.Text & "','" & txtTitulo.Text & "')"
MnjCaja "Archivo Guardado", ""
Ejecutar SQL
Limpiar
txtImagen.enabled = False
txtTitulo.enabled = False
txtUrl.enabled = False
' txtSeccion.enabled = False
gridBusqueda.enabled = True
llenaBarra menu, True, False, False, True, True, True, True, True, True, True
Command1.enabled = False
Call gridBaner
llenaBarra menu, True, False, False, True, True, True, True, True, True, True
Case "Cancelar":
Limpiar
txtImagen.enabled = False
txtTitulo.enabled = False
txtUrl.enabled = False
'txtSeccion.enabled = False
gridBusqueda.enabled = True
llenaBarra menu, True, False, False, True, True, True, True, True, True, True
Command1.enabled = False
End Select
End Sub
---aqui esta todo todo jjejeje... tengan piedad de mi soy nueva en esto de la programacion. :S