Visual Basic - AYUDENME A DEFINIR O CORREGIR ESTA VARIABLE

Life is soft - evento anual de software empresarial
 
Vista:

AYUDENME A DEFINIR O CORREGIR ESTA VARIABLE

Publicado por Boris (5 intervenciones) el 23/06/2005 16:39:39
Amigos por favor ayudenme en esto, he credo codigo para poder leer informacion de una base de datos de foxpro,pero cuando lo ejecuto me indica error
Error de compilacion
No se a definido el tipo definido por el usuario
en el codigo :

Dim ws As Workspace

estoy queriendo hacer en objeto de acceso en datos DAO
parte del codigo es el sgte:

Dim ws As Workspace
Dim bd As Database
Dim reg As Recordset

Private Sub Form_Load()
Set ws = DBEngine.Workspaces(0)
Set bd = ws.OpenDatabase("d:\Registro", False, False, "Foxpro 2.6;")
Set reg = bd.OpenRecordset("Registro", dbOpenDynaset)
Datos
CmdGrabar.Enabled = False
End Sub

Private Sub Datos()
If reg.EOF Then Exit Sub
If reg.BOF Then Exit Sub
TxtCodigo.Text = IIf(IsNull(reg!Copar), "", reg!Copar)
TxtApellidos.Text = IIf(IsNull(reg!Apell), "", reg!Apell)
TxtNombres.Text = IIf(IsNull(reg!Nombr), "", reg!Nombr)
TxtDni.Text = IIf(IsNull(reg!Lepar), "", Str$(reg!Lepar))
TxtLugar.Text = IIf(IsNull(reg!Lupar), "", reg!Lupar)
TxtFechaN.Text = IIf(IsNull(reg!Fnpar), "", reg!Fnpar)
TxtTele.Text = IIf(IsNull(reg!Tepar), "", Str$(reg!Tepar))
TxtDomicilio.Text = IIf(IsNull(reg!Dopar), "", reg!Dopar)
TxtReferencia.Text = IIf(IsNull(reg!Repar), "", reg!Repar)
TxtTelefono.Text = IIf(IsNull(reg!Trpar), "", Str$(reg!Trpar))
Txtcurso.Text = IIf(IsNull(reg!Nomcu), "", reg!Nomcu)
Txtcodig.Text = IIf(IsNull(reg!Codig), "", Str$(reg!Codig))
TxtHoras.Text = IIf(IsNull(reg!Horas), "", Str$(reg!Horas))
End Sub

Private Sub CmdGrabar_Click()
reg!Copar = RTrim$(TxtCodigo.Text)
reg!Apell = RTrim$(TxtApellidos.Text)
reg!Nombr = RTrim$(TxtNombres.Text)
reg!Lepar = RTrim$(TxtDni.Text)
reg!Lupar = RTrim$(TxtLugar.Text)
reg!Fnpar = RTrim$(TxtFechaN.Text)
reg!Tepar = RTrim$(TxtTele.Text)
reg!Dopar = RTrim$(TxtDomicilio.Text)
reg!Repar = RTrim$(TxtReferencia.Text)
reg!Trpar = RTrim$(TxtTelefono.Text)
reg!Nomcu = RTrim$(Txtcurso.Text)
reg!Codig = RTrim$(Txtcodig.Text)
reg!Horas = RTrim$(TxtHoras.Text)
If MsgBox("Desea Grabar el registro?", 4 + 32 + 256, "grabar") = 6 Then
reg.Update
End If
CmdGrabar.Enabled = False
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 14
Ha aumentado 1 puesto en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

RE:AYUDENME A DEFINIR O CORREGIR ESTA VARIABLE

Publicado por SuNcO (599 intervenciones) el 23/06/2005 20:24:29
"No se a definido el tipo definido por el usuario"

Ese error generalmente sale cuando no pones bien las referencias.. aun asi, no dices exactamente en cual linea te marca ese error.. seguro es en las variables
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar