Attribute VB_Name = "Module1"
Option Explicit
Dim b1() As Byte
Dim b2() As Byte
Global cn As ADODB.Connection
Global i As Integer
Global tmp As Integer
Global ok As Boolean
Global ok2 As Boolean
Global rs As ADODB.Recordset
Global rs1 As ADODB.Recordset
Global rs_del As ADODB.Recordset
Global rs_rech As ADODB.Recordset
Global req As String
Global taille As Variant
Global titre As Variant
Global op As Integer
Global frm As Integer
Global typ As String
Global us As String
Global pas As String

Public Sub Main()
Extrait ' on extrait les ocx ou dll sur le disk et on les enregistre
DoEvents
Pharmacie.Show
frmLogin.Show (1)
End Sub

Public Sub connect()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pharm.mdb;Persist Security Info=False"
cn.Open
End Sub
Public Function ForceMaj(KeyAscii As Integer)
If KeyAscii > 96 And KeyAscii < 123 Then
      KeyAscii = KeyAscii - 32
End If
 ForceMaj = KeyAscii
 End Function



Sub Extrait() 'fonction pour extraire les ocx sur le disk
    Dim cc1
        cc1 = App.Path & "\Basics.ocx"
        b1 = LoadResData(101, "CUSTOM") ' contient basic.ocx (reyXP_Basic.ocx)

If FileExist("" & cc1) Then GoTo 2 ' si le fichier existe deja on pass

    Open cc1 For Binary As #1 ' on extrait l'ocx
        Put #1, , b1
    Close #1
    DoEvents
2

DoEvents
    Shell "regsvr32 /s basics.ocx"
Fin:
DoEvents
End Sub

'fonction pour verifier l'existance d'un fichier
Private Function FileExist(file As String) As Boolean
Dim l As Long
    On Error GoTo FExErr
        l = FileLen(file)
            FileExist = True
        Exit Function
FExErr: FileExist = False
Exit Function
End Function


