Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Connecting ADO to Access 2000 DB with workgroup administrator

RTJ3RTJ3 Posts: 1Member
Hi,

I think i am have a bit of a blond day (no offence to blonds!)I am trying to read/write to an Access 2k table that is using WG adminstrator, the connection tests fine and the user account has full permissions but when you try to connect any object it fails due to lack of permissions!

Any ideas?

Comments

  • dokken2dokken2 Posts: 532Member
    : Hi,
    :
    : I think i am have a bit of a blond day (no offence to blonds!)I am trying to read/write to an Access 2k table that is using WG adminstrator, the connection tests fine and the user account has full permissions but when you try to connect any object it fails due to lack of permissions!
    :
    : Any ideas?
    :
    this has worked in the past-

    [code]
    Public Sub AdoConnectSecureDB()
    Dim cn As ADODB.Connection, rs As ADODB.Recordset
    Dim sCon As String

    On Error GoTo erh

    'CONNECTION STRING
    '9/12/02 - ADO CONNECTION TO A SECURE ACCESS DB
    sCon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "User ID=ACCOUNT;Password=PASSWORD;" & _
    "Data Source=C:MyPathMyMDB.mdb;" & _
    "Persist Security Info=False;" & _
    "Jet OLEDB:System database=c:MyPathMySystem.mdw"

    'CREATE NEW CONNECTION
    Set cn = New ADODB.Connection
    'OPEN CONNECTION WITH CONNECTION STRING
    cn.Open sCon
    'CREATE NEW RECORDSET
    Set rs = New ADODB.Recordset
    'OPEN RECORDSET
    rs.Open "table12", cn, adOpenDynamic, adLockOptimistic, adCmdTable
    rs.MoveFirst

    'TRAVERSE RECORDS
    Do While Not rs.EOF
    MsgBox rs!MyField
    rs.MoveNext
    Loop

    'CLOSE/RELEASE RESOURCES
    xit:
    rs.Close
    cn.Close
    Set rs = Nothing
    Set cn = Nothing
    Exit Sub

    erh:
    MsgBox Err.Description, vbCritical, Err.Number
    Resume xit
    End Sub
    [/code]
Sign In or Register to comment.