CCCC CCCC CCCC
CCCC CCCC CCCC
Module Module1
Public Conexion As ADODB.Connection
Public caracteristicas As ADODB.Recordset
Public Camposcarac As ADODB.Fields
Public editorial As ADODB.Recordset
Public Camposedit As ADODB.Fields
Public detalle As ADODB.Recordset
Public Camposdeta As ADODB.Fields
Public diccionario As ADODB.Recordset
Public Camposdic As ADODB.Fields
Public idioma As ADODB.Recordset
Public Camposidi As ADODB.Fields
Public tipo As ADODB.Recordset
Public Campostipos As ADODB.Fields
Dim Respuesta As Integer
Public Sub AbrirBase()
Conexion = New ADODB.Connection
Conexion.ConnectionString = "Provider=Microsoft.MSSQL Server;Data
Source=DICCIONARIO.mdb;"
Try
Conexion.Open()
Catch ex As Exception
End Try
Respuesta = Conexion.Errors.Count()
If Respuesta <> 0 Then
MsgBox("ERROR: No se logro la Conexi�n", MsgBoxStyle.Critical, "Error
de Conexi�n")
Else
MsgBox("La Conexi�n Fue Satisfactoria", MsgBoxStyle.Information,"Conexi�n
Establecida")
End If
End Sub
Public Sub AbrirCaracteristicas()
caracteristicas = New ADODB.Recordset
With caracteristicas
.ActiveConnection = Conexion
.CursorType = CursorTypeEnum.adOpenKeyset
.LockType = LockTypeEnum.adLockOptimistic
.Open("Select*from Form1")
End With
End Sub
Public Sub AbrirEditorial()
editorial = New ADODB.Recordset
With editorial
.ActiveConnection = Conexion
.CursorType = CursorTypeEnum.adOpenKeyset
.LockType = LockTypeEnum.adLockOptimistic
.Open("Select*from Form2")
End With
End Sub
Public Sub AbrirIdioma()
idioma = New ADODB.Recordset
With idioma
.ActiveConnection = Conexion
.CursorType = CursorTypeEnum.adOpenKeyset
.LockType = LockTypeEnum.adLockOptimistic
.Open("Select*from Form3")
End With
End Sub
Public Sub AbrirDetalle()
detalle = New ADODB.Recordset
With detalle
.ActiveConnection = Conexion
.CursorType = CursorTypeEnum.adOpenKeyset
.LockType = LockTypeEnum.adLockOptimistic
.Open("Select*from Form4")
End With
End Sub
Public Sub AbrirDiccionario()
diccionario = New ADODB.Recordset
With diccionario
.ActiveConnection = Conexion
.CursorType = CursorTypeEnum.adOpenKeyset
.LockType = LockTypeEnum.adLockOptimistic
.Open("Select*from Form5")
End With
End Sub
Public Sub AbrirTipo()
tipo = New ADODB.Recordset
With tipo
.ActiveConnection = Conexion
.CursorType = CursorTypeEnum.adOpenKeyset
.LockType = LockTypeEnum.adLockOptimistic
.Open("Select*from Form6")
End With
End Sub
Public Sub CerrarBase()
Try
Conexion.Close()
Catch ex As Exception
MsgBox("ERROR: No se logro el Cierre de Conexi�n a la Base de Datos, ya que la Base
de Datos NO Esta Abierta o NO se Hall�", MsgBoxStyle.Critical,"Error de Cierre de
Conexi�n")
Exit Sub
End Try
Try
Respuesta = Conexion.Errors.Count()
Catch ex As Exception
End Try
If Respuesta = 0 Then
MsgBox("Conexi�n Fue Cerrada Satisfactoriamente",MsgBoxStyle.Information, "Conexi�n
Cerrada")
End If
End Sub
End Module