Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX component can't create object 1

Status
Not open for further replies.

LittleSmudge

Programmer
Mar 18, 2002
2,848
GB
I have a small piece of cosde that works well for many users but some users on Access 2000 on WinXP get the following error.


In a Class Module
Code:
Property Get DatabaseNameAndPath() As String

Dim db As Object
Set db = CurrentDb()
DatabaseNameAndPath = CurrentDb.Name
End Property


I've tried
Dim db As Object
Dim db As Database
Dim db As DAO.Database

Problem machines get an Error No 429
"ActiveX component can't create object"
on the line
Set db = CurrentDb()


What is going on ?





G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
For DBName & Path use
Code:
CurrentProject.FullName

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Okay mp9 I've change the code and still get problems.


So I've narrowed it down to something as simple as

Code:
Debug.Print CurrentDb.Name

This line gives a 429 error ActiveX component can't create Object





G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Thanks Zameer that has moved the problem on to another line ( Same error No & message )


Code:
Dim dbs As Database
Dim tdf As TableDef
Set dbs = OpenDatabase(strLinkSourceDB)    ' This Line fails

This is in the Remaking table links routine where I then go on to

Code:
For Each tdf In dbs.TableDefs
    If Left(tdf.Name, 4) <> "MSys" Then
        'Do not link to the System tables
        'Creating links
        DoCmd.TransferDatabase acLink, "Microsoft Access", strLinkSourceDB, acTable _
                                     , tdf.Name, tdf.Name
    End If
Next tdf


G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Can you post the complete code? I can't find dim "strLinkSourceDB" anywhere

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Yes ZmrAbdulla I was trying to minimise the 'clutter' by not including too much irrelevent stuff.

Here is it all

Code:
Public Sub RelinkTables()
Dim strPath As String
Dim strBE As String

strPath = Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\"))

If Len(Dir(strPath & "XXXBE.mdb")) > 0 Then
    strBE = strPath & "XXXBE.mdb"
Else
    MsgBox "The BackEnd file 'XXXBE' cannot be found." & vbLf _
         & "Please correct this problem and start again.", _
         , "Fatal error, this application will now close"
    Application.Quit
End If

' Just in case some links exists to old files we now delete all existing links.
intResult = SysCmd(acSysCmdSetStatus _
          , "Deleting any old links that may exist")
Call DeleteTableLinks

' Now relink to all tables in the strBE file.
intResult = SysCmd(acSysCmdSetStatus _
          , "Creating links to " & strBE)
Call RemakeTableLinks(strBE)
End Sub

and

Code:
Public Sub RemakeTableLinks(strLinkSourceDB As String)
On Error GoTo Err_RemakeTableLinks
Dim dbs As Database
Dim tdf As TableDef
Dim tdfCount As Long
Dim intCount As Long
Dim strFile As String
Dim strPath As String

Set dbs = OpenDatabase(strLinkSourceDB)    ' THIS line fails BUT only on SOME machines running Windoz XP & Access 2000

'Counting tables in the source DB
For Each tdf In dbs.TableDefs
    If Left(tdf.Name, 4) <> "MSys" Then
        'Do not link to the System tables
        tdfCount = tdfCount + 1
    End If
Next tdf
'Check all tables in source DB (dbs)
For Each tdf In dbs.TableDefs
    If Left(tdf.Name, 4) <> "MSys" Then
        'Do not link to the System tables
        'Creating links
        intCount = intCount + 1
        intResult = SysCmd(acSysCmdSetStatus _
                  , "Progress: Linking table " & intCount _
                  & " of " & tdfCount)
        DoCmd.TransferDatabase acLink _
             , "Microsoft Access" _
             , strLinkSourceDB, acTable _
             , tdf.Name, tdf.Name
    End If
Next tdf
'Close source DB
dbs.Close
Set dbs = Nothing

Exit_RemakeTableLinks:
Application.Echo True
Exit Sub

Err_RemakeTableLinks:
MsgBox Err.Description & vbLf & "In clsLinkedTable_RemakeTableLinks ", , Err.Number
Resume Exit_RemakeTableLinks
End Sub

G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
LittleSmudge,
I have tried your code working fine with me. (Win 2000 SP4, Access 2002)
As it is giving problem in some machines there can be chances of patch updates. May be RobCPA's link useful.

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Rob
I really thought you were on to something there with that FAQ of yours.

However the ftp site in the link only contains .EXE files - no DLL file anywhere and no DAO350 or DAO360 file names regardless of suffix.


The person I'm working with ( remotely, which always makes life interesting ) informs me that she has the C:\Program Files\Common Files\Microsoft Shared\DAO\ folder on her machine and it does contain both DAO250.dll and DAO360.dll but when she runs the Regsvr32.exe line it tells her that neither file exists.

Any clues as to what might be tripping her up ?



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
This has a download and possible(?) idea.
ActiveX Component Error
thread181-725389
 
The user informs me that she has deleted the original and replaced it with the one from my pc ( which works ) and it still tells her that the file doesn't exist.


Does regsvr32.exe work with the full path name style or must you use the \Progra~1\ format ?


g

G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
On Windows XP I used full path name style to register MZtools, and it worked.
 
Thanks people.

I ended up zipping my own copy of the Dll and sending it out to users and following the process in Rob's FAQ. Alall but one user has reported success.

So thanks for your time and interest.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top