Connecting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ruchit garg

    Connecting

    Hi All,

    I am using a MS-Access with VB6.0.

    I wanted to open simultaneous connections on a single MDB file. how
    can i achive that?

    I am using the following code right now and get error if i try to open
    a connection which is already open by another module.
    ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''
    Set myConnection = New ADODB.Connectio n
    Set myRecordset = New ADODB.Recordset
    On Error GoTo perror

    'open the database connection
    myConnection.Op en "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ="
    & "c:\rdso\cadat. mdb"
    sqlStatement = "Select * from " & TestName
    ' get the record set and enter values
    With myRecordset
    .CursorType = 1
    .LockType = 3
    .Open sqlStatement, myConnection
    End With
    ''''''''''''''' ''''''''''''''' '''''''''''''''


    Please help


    Ruchit Garg
  • Larry Linson

    #2
    Re: Connecting

    ruchitgarg@yaho o.com (ruchit garg) wrote in message news:<83c96c35. 0408110613.ef97 b0f@posting.goo gle.com>...

    [color=blue]
    > I am using a MS-Access with VB6.0.
    >
    > I wanted to open simultaneous connec-
    > tions on a single MDB file. how
    > can i achive that?[/color]

    What do you intend to accomplish with multiple connections to a
    file-server database such as Jet? You can open multiple Recordsets on
    a single Connection -- make sure the connection object is in a
    standard module and is public so it will be available where you need
    it.

    And, because DAO is the native language of Jet databases, I'd suggest
    you use that rather than ADO, even from VB. Microsoft overhyped ADO,
    as they have so many other "access methods of choice for the
    foreseeable future", only to have it be, for VB, another one-release
    wonder (however, it's survived three releases of Access, but still DAO
    is preferrable for Jet databases) before it was forgotten in favor of
    ADO.NET which is quite a different package and has quite a different
    interface.

    Larry Linson
    Microsoft Access MVP

    Comment

    Working...