Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

error de compilacion, no se ha definido el tipo definido por el usuario

Estas en el tema de error de compilacion, no se ha definido el tipo definido por el usuario en el foro de Visual Basic clásico en Foros del Web. ayuda error de compilacion, no se ha definido el tipo definido por el usuario, no se por que me sale esto: Function UploadFile(ByVal HostName As ...
  #1 (permalink)  
Antiguo 16/07/2014, 17:20
 
Fecha de Ingreso: julio-2014
Ubicación: Sinaloa
Mensajes: 3
Antigüedad: 9 años, 9 meses
Puntos: 0
error de compilacion, no se ha definido el tipo definido por el usuario

ayuda error de compilacion, no se ha definido el tipo definido por el usuario, no se por que me sale esto:

Function UploadFile(ByVal HostName As String, ByVal UserName As String, ByVal Password As String, ByVal LocalFileName As String, ByVal RemoteFileName As String)
Dim FTP As Inet1
y la linea del dim se me marca y no se puede correr el programa, que es lo que pasa?
es URGENTE, Necesito ayuda!!
  #2 (permalink)  
Antiguo 16/07/2014, 20:00
Avatar de gnzsoloyo
Moderador criollo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Actualmente en Buenos Aires (el enemigo ancestral)
Mensajes: 23.324
Antigüedad: 16 años, 4 meses
Puntos: 2658
Respuesta: error de compilacion, no se ha definido el tipo definido por el usuario

Es un error demasiado básico...

Cita:
no se ha definido el tipo definido por el usuario
Código vb:
Ver original
  1. Dim FTP As Inet1
¿De donde sale esa clase "Inet1"?
__________________
¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...
"El problema es la interfase silla-teclado." (Gillermo Luque)
  #3 (permalink)  
Antiguo 16/07/2014, 20:18
Avatar de culd  
Fecha de Ingreso: noviembre-2003
Mensajes: 959
Antigüedad: 20 años, 5 meses
Puntos: 19
Respuesta: error de compilacion, no se ha definido el tipo definido por el usuario

Seguramente no tenes el objeto "Internet Control" cargado en el proyecto.
  #4 (permalink)  
Antiguo 17/07/2014, 16:39
 
Fecha de Ingreso: julio-2014
Ubicación: Sinaloa
Mensajes: 3
Antigüedad: 9 años, 9 meses
Puntos: 0
Respuesta: error de compilacion, no se ha definido el tipo definido por el usuario

tengo el objeto e incluso active las referencias, que mas se necesita o que?
  #5 (permalink)  
Antiguo 17/07/2014, 16:53
Avatar de gnzsoloyo
Moderador criollo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Actualmente en Buenos Aires (el enemigo ancestral)
Mensajes: 23.324
Antigüedad: 16 años, 4 meses
Puntos: 2658
Respuesta: error de compilacion, no se ha definido el tipo definido por el usuario

Postea todo el código, entero, y veremos.
En alguna parte no has puesto algo... El compilador no inventa el error. Lo encuentra.
__________________
¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...
"El problema es la interfase silla-teclado." (Gillermo Luque)
  #6 (permalink)  
Antiguo 17/07/2014, 17:00
 
Fecha de Ingreso: julio-2014
Ubicación: Sinaloa
Mensajes: 3
Antigüedad: 9 años, 9 meses
Puntos: 0
Respuesta: error de compilacion, no se ha definido el tipo definido por el usuario

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

Última edición por nohemy15; 17/07/2014 a las 17:24

Etiquetas: vb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:48.