ayuda con opendatabase y access2000
Publicado por jon (10 intervenciones) el 10/02/2010 17:16:37
hola programadores me podrian ayudar con el sgt codigo eh creado un procedimiento para el menu de mi fromMDI pero me sale un error de que no reconoce el formato de la base de datos, no se como seria con access 2000 ya tengo el sp6 insatalado.
EN UN MODULO EH DECLARADO ESTAS VARIABLES
Public db As Database
Public rs As Recordset
Public sql As string
Sub setMDIfrom1Menu()
Dim C1 As Variant
Set cx = OpenDatabase(App.Path & "\Prueba1.mdb") 'AQUI EL MSGBOX DE ERRROR
sql = ""
sql = "select * from usuariosist"
sql = sql + " where tipo_usuario = '" & FrmAccesoSiste.Dcnivel & "'"
Set rs = cx
Set rs = dcx.OpenRecordset(sql, 2)
If rs.RecordCount > 0 Then
C1 = rs!tipo_usuario
'C2 = rs!cod_tipo_usuario
End If
C1 = Trim(StrConv(C1, vbUpperCase))
If C1 = "ADMINISTRADOR" Then
With MDIForm1
.mnumante.Enabled = True
'.eliminacionc.Enabled = True
End With
End If
If C1 = "DIGITADOR" Then
With MDIForm1
.mnumante.Enabled = False
.mnuUsuario.Enabled = False
.ingresoalsist.Enabled = False
.modificacionc.Enabled = False
.eliminacionc.Enabled = False
End With
End If
End Sub
gracias por su ayuda emviar [email protected]
EN UN MODULO EH DECLARADO ESTAS VARIABLES
Public db As Database
Public rs As Recordset
Public sql As string
Sub setMDIfrom1Menu()
Dim C1 As Variant
Set cx = OpenDatabase(App.Path & "\Prueba1.mdb") 'AQUI EL MSGBOX DE ERRROR
sql = ""
sql = "select * from usuariosist"
sql = sql + " where tipo_usuario = '" & FrmAccesoSiste.Dcnivel & "'"
Set rs = cx
Set rs = dcx.OpenRecordset(sql, 2)
If rs.RecordCount > 0 Then
C1 = rs!tipo_usuario
'C2 = rs!cod_tipo_usuario
End If
C1 = Trim(StrConv(C1, vbUpperCase))
If C1 = "ADMINISTRADOR" Then
With MDIForm1
.mnumante.Enabled = True
'.eliminacionc.Enabled = True
End With
End If
If C1 = "DIGITADOR" Then
With MDIForm1
.mnumante.Enabled = False
.mnuUsuario.Enabled = False
.ingresoalsist.Enabled = False
.modificacionc.Enabled = False
.eliminacionc.Enabled = False
End With
End If
End Sub
gracias por su ayuda emviar [email protected]
Valora esta pregunta


0