Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006

    Unanswered: error 7866 using .opendatabasemethod

    here is the code it opens dab and then give the error 7866 when opoencurrent
    dbcontab opends perfect where is the error before it works fine
     Set dbContab = OpenDatabase(dirbase & archbase, False, False, ";pwd=" & 
    On Error GoTo 0
    'error 7866 exclusive mode which is not true ,when opendatabase why
    Set appAccess = CreateObject("Access.Application")
    appAccess.OpenCurrentDatabase dirbase & archbase, , clavebd
    For Each tdf In dbContab.TableDefs
    If Not (tdf.Attributes And dbSystemObject) <> 0 Then
    If tdf.Name = "prefinancieros" Then
    On Error GoTo 0
    SqlVerSQL = dirbase & "logtrans." & archbase
    On Error Resume Next
    appAccess.DoCmd.TransferDatabase acExport, "Microsoft Access", SqlVerSQL, 
    acTable, tdf.Name, tdf.Name, False   ' true solo definiciones"
    End If
    End If
    Last edited by loquin; 08-15-06 at 16:16.

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    what version of VB are you using?

    what is the error description associated with error number 7866?
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts