NEED HELP FOR ADODC CONNECTION

HI FRNDS.....CAN SOMEONE PLZ HELP ME TO CONNECT ACCESS WID VB VIA ADODC CODING...I M DOIN ONE PROJCT IN WHICH I HAVE TO ADD AND DELETE FIELDS IN ACCESS FROM VB....CAN ANYONE PLZ SEND ME THE SOURCE CODE TO ADD N DELETE DATABASES AND TO MAE ADODC CONNECTION......I WOUL B VERY THANKFULL TO U....PLZ HELP ME OUT......

Comments

  • : HI FRNDS.....CAN SOMEONE PLZ HELP ME TO CONNECT ACCESS WID VB VIA
    : ADODC CODING...I M DOIN ONE PROJCT IN WHICH I HAVE TO ADD AND DELETE
    : FIELDS IN ACCESS FROM VB....CAN ANYONE PLZ SEND ME THE SOURCE CODE
    : TO ADD N DELETE DATABASES AND TO MAE ADODC CONNECTION......I WOUL B
    : VERY THANKFULL TO U....PLZ HELP ME OUT......
    :

    try using this, make sure you also included the microsoft activex data object.

    put this in a module

    Public Function OpenRecordset(sqltxt As String, conn As ADODB.Connection) As ADODB.Recordset
    Dim temprs As New ADODB.Recordset
    Set OpenRecordset = New ADODB.Recordset
    temprs.CursorLocation = adUseClient
    temprs.Open sqltxt, conn, adOpenDynamic, adLockOptimistic
    Set OpenRecordset = temprs
    Set temprs = Nothing
    End Function

    to connect
    Set yourconn = New ADODB.Connection
    yourconn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
    yourconn.CursorLocation = adUseClient
    yourconn.Open App.Path & "yourDB.mdb"
    your recordset handler
    set yourrs = openrecordset("Select * from my table", yourconn)
    hope this help.


    I'm the best there is,
    the best there was,
    and the best there ever will be.
    hahahahaha lolz :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion