Please help me, about make class module to manipulation database
ACCESS (*.mdb), so i can execute SQL statement like SELECT, INSERT, DELETE and UPDATE database itself..

I made my own project sample VB6.0 with no class modules at all, i thought my code/script not very powerfull..

Can you help me??? to make class modules connection, execute and get row data too...

Thank a millions

Create a class with private members like instances of ADODB.Connection, ADODB.Recordset etc. and with functions which open the Connection, functions which open, manipuate and close the Recordset etc.

Something like:

Option Explicit
Private rs As New ADODB.Recordset
Private conn As New ADODB.Connection

Public Property Let Connection(ByVal vData As ADODB.Connection)
    Set conn = vData
End Property

Public Property Get Connection() As ADODB.Connection
    Set Connection = conn
End Property

Public Property Let Recordset(ByVal vData As ADODB.Recordset)
    Set rs = vData
End Property

Public Property Get Recordset() As ADODB.Recordset
    Set Recordset = rs
End Property

Public Function Initialise(ByVal Connection_string As String, ByVal Recordset_string As String) As clsConnection
    conn.Open Connection_string
    rs.Open Recordset_string, con, adOpenKeyset, adLockOptimistic
    Set Initialise = Me
End Function

Note that this is just a template and may or may not work...I haven't as such tested it. Use it as a reference to create your own class.

Thanks alot,,
How about function to get rows data, execute sql etc..
like SELECT, INSERT, DELETE and UPDATE... in the same class itself

Please add your code SOS ....
Thanks b4 ya

Best Regards

This article has been dead for over six months. Start a new discussion instead.