Attribute VB_Name = "conn"
Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer

Public annual2010 As ADODB.Connection

Public rsregistration As New ADODB.Recordset

Public Function annual2010Dir() As String
    If Right$(App.Path, 1) = "/" Then
        annual2010Dir = App.Path
    Else
        annual2010Dir = App.Path & "/"
    End If
End Function

Sub dbconnect()

    Set annual2010 = New ADODB.Connection
    annual2010.Open "Provider=Microsoft.Jet.Oledb.4.0; data source =" & annual2010Dir & "\Database\dbAnnual.mdb; Persist Security Info=False;Jet OLEDB:Database Password=annual2010"

    Set rsregistration = New ADODB.Recordset
    rsregistration.Open "Select * from newbldg", annual2010, adOpenStatic, adLockOptimistic

End Sub
