bueno disculpa lo k dije en la pregunta k codigo serviria para la conexion en el modulo no keria decir "k hagan las cosas"  y "de copiar y pegar"solo me referia a codigos sin erroneo y si se visual basic no lo preguntaria en el tema,por lo que habia hay muxos kodigos de conexion solo eso...
mira tengo ese codigo k no se si serviria muxo pero no si plantearlo en el modulo
Option Explicit
' ----------------------------------------------------------------------------------------------
' \ -- Descripción : Ejemplo simple para eliminar un registro solo o un rango de filas seleccionado
' ----------------------------------------------------------------------------------------------
' ----------------------------------------------------------------------------------------------
' -- Declaraciones
Private Declare Function SetErrorMode Lib "kernel32" (ByVal wMode As Long) As Long
Private Declare Sub InitCommonControls Lib "Comctl32" ()
Dim cn      As ADODB.Connection
Dim Rs      As ADODB.Recordset
' -----------------------------------------------------------------------------------------
' \ -- Función para cargar la tabla en la grilla y otras opciones
' -----------------------------------------------------------------------------------------
Private Sub pv_Flexgrid_Initialize(MSHFlex As MSHFlexGrid, cn As ADODB.Connection)    
    ' -- Declarar y crear el recordset
    Set Rs = New ADODB.Recordset
    ' -- Ejecutar el command SQL de la tabla productos
    With Rs
        .CursorLocation = adUseClient
        ' -- Ejecutar comando SQL
        .Open "SELECT [IDProducto],[NombreProducto],[UnidadesEnExistencia],[PrecioUnidad] From Productos Order by [IdProducto]", cn, adOpenStatic, adLockOptimistic
    End With
    With MSHFlex
        .AllowUserResizing = flexResizeColumns
        .FixedCols = 0
        .FixedRows = 1
        .ForeColorFixed = vbHighlight
        .BackColorFixed = vbWhite
        .GridLinesFixed = flexGridDots
        .RowHeight(0) = 450
        .GridColor = RGB(190, 190, 190)
        .SelectionMode = flexSelectionByRow
        Set .DataSource = Rs        
        Dim i As Integer
        For i = 0 To .Cols - 1
            .ColWidth(i) = 1700
        Next
        .Refresh
    End With    
End Sub
' -----------------------------------------------------------------------------------------
' \ -- Sub para ejecutar la consulta de eliminación
' -----------------------------------------------------------------------------------------
Private Sub ExecuteQuery(cn As ADODB.Connection, sQuery As String)
On Error GoTo Error_Handler
    ' -- Llamar al método Execute para Eliminar el registro
    cn.Execute sQuery
Exit Sub
Error_Handler:
MsgBox Err.Description, vbCritical
End Sub
' -----------------------------------------------------------------------------------------
' \ -- Botón para eliminar el registro
' -----------------------------------------------------------------------------------------
Private Sub Command1_Click()            
    On Error GoTo Error_Handler
    Dim sQuery As String    
    With MSHFlexGrid1
        ' -- Comprobar que hay una fila activa
        If .Row <= 0 Then
            MsgBox " No hay ninguna fila seleccionada para eliminar ", vbExclamation
            Exit Sub
        End If
        ' -- Mostrar en un mensaje la cantidad de filas a eliminar
        If MsgBox("Se van a eliminar " & CStr(Abs(.Row - .RowSel) + 1) & " registros ... ¿ Continuar?", vbQuestion + vbYesNo) = vbNo Then
            Exit Sub
        End If        
        ' -- Obtener valores del rango seleccionado
        Dim i As Long
        Dim j As Long
        Dim k As Long
        If .Row < .RowSel Then i = .Row: j = .RowSel
        If .Row > .RowSel Then j = .Row: i = .RowSel
        If .Row = .RowSel Then i = .Row: j = .Row
        ' -- Recorrer en un bucle el rango de selección
        For k = i To j
            .Row = k
            sQuery = "DELETE * FROM [Productos] WHERE [IdProducto] = " & CLng(.TextMatrix(.Row, 0))
            Call ExecuteQuery(cn, sQuery)
        Next        
        ' -- Deshabilitar el redraw para el MSHFlexGrid
        .Redraw = False
        ' -- Cargar nuevamente el Grid para actualizar los datos
        Set .DataSource = Nothing
        ' -- Ejecutar el método Requery para volver a cargar el recordset actualizado
        Rs.Requery
        ' -- Enlazar el conjunto de datos con el Grid
        Set .DataSource = Rs
        ' -- Volver a habilitar el repintado del control Flex
        .Redraw = True
    End With    
    ' -- Errores
    Exit Sub
Error_Handler:
MsgBox Err.Description, vbCritical
End Sub
' --------------------------------------------------------------------------------------------
' \ -- Inicio
' --------------------------------------------------------------------------------------------
Private Sub Form_Load()
    ' -- ruta de la base de datos
    Dim path_bd As String
    path_bd = App.Path & "datadb1.mdb"
    With MSHFlexGrid1
        ' --Crear una Nueva conexión
        Set cn = New ADODB.Connection
        ' -- Abre la bd pasando de la cadena de conexión OLEDB
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & path_bd & ";Persist Security Info=False"
        Call pv_Flexgrid_Initialize(MSHFlexGrid1, cn)
    End With
End Sub
' --------------------------------------------------------------------------------------------
' \ -- Fin -- Descargar
' --------------------------------------------------------------------------------------------
Private Sub Form_Unload(Cancel As Integer)
    If Not Rs Is Nothing Then
        If Rs.State = adStateOpen Then Rs.Close
        Set Rs = Nothing
    End If
    Call pvCloseDataBase
End Sub
' --------------------------------------------------------------------------------------------
' \ -- Iniciar InitCommonControls
' --------------------------------------------------------------------------------------------
Private Sub Form_Initialize()
    Call SetErrorMode(2)
    Call InitCommonControls
End Sub
' --------------------------------------------------------------------------------------------
' \ -- Cerrar conexión
' --------------------------------------------------------------------------------------------
Private Sub pvCloseDataBase()
    If Not cn Is Nothing Then
       If cn.State = adStateOpen Then cn.Close
       Set cn = Nothing
    End If
End Sub