Avatar billede mundt Nybegynder
19. september 2002 - 10:23 Der er 10 kommentarer og
1 løsning

Microsoft Access can't find the macro 'SattlineSearcher.'

Jeg har lavet en database med følgende indhold:

3 tabeller
1 formular
1 makro (AutoExec)
2 moduler

Når jeg åbner databasen får jeg følgende oplysning i en msgbox:

Microsoft Access can't  find the  macro 'SattlineSearcher.'

The macro (or its macro group) doesn't exist, or the macro is new but hasn't been saved.
Note that when yue enter the macrogroupname.macroname syntax in an argument, you must specify the name the macro's macro group was last saved under.

Den eneste makro jeg har er jo AutoExec og den har jeg gemt!

Hvad gør jeg?
Avatar billede terry Ekspert
19. september 2002 - 10:26 #1
take a look at th eautoexec macro and see what it is trying to do
Avatar billede 3xa Nybegynder
19. september 2002 - 10:27 #2
Den form autoexec'en åbner har temmelig sikkert en "on open" function der peger på den makro....
Avatar billede mundt Nybegynder
19. september 2002 - 11:53 #3
Der er ingen events som peger på AutoExec. Det eneste AutoExec gør et at den kalder en function Startup som kalder en Sub som kalder en anden Sub.


'********************************************************************************************
'This function is called from the function Startup and makes a raw copy of the content of the
'Journalfile into the JourInfoLink.
'
'ver. 001  RMun    2002-09-04
'********************************************************************************************

Public Sub OpenFile()
On Error GoTo ErrHandler

    'Declaration of variables
    Dim strSQL As String

    DoCmd.Hourglass True
    DoCmd.SetWarnings False
    'Delete existing table JourInfoLink
    DoCmd.DeleteObject acTable, "JourInfoLink"
    'Makes a linked table - JourInfoLink - to the journalfile
    DoCmd.TransferText acLinkFixed, "Jouinfo Link Specification", "JourInfoLink", cStrPath
    strSQL = "SELECT JourInfoLink.* INTO JournalInfo FROM JourInfoLink;"
    'Transfers all data from the table JourInfoLink to the table JournalInfo
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
    'Calls the procedure SearchJournalInfo
    SearhJournalInfo
    DoCmd.Hourglass False
    Exit Sub

ErrHandler:
    MsgBox Err.Description
    Exit Sub
   
End Sub

'********************************************************************************************
'This procedure is called from the function Openfile. It runs through the journalfile and
'fetches all relevant information.
'
'ver. 001  RMun    2002-09-04
'********************************************************************************************

Public Sub SearhJournalInfo()
On Error GoTo ErrHandler

    'Declaration of variables
    Dim con As ADODB.Connection
    Dim rstJournalInfo As ADODB.Recordset
    Dim rstTagData As ADODB.Recordset
    Dim strOccuranceTime As String
    Dim strTagName As String
    Dim strSQL As String
   
    Set rstJournalInfo = New ADODB.Recordset
    Set rstTagData = New ADODB.Recordset
    Set con = New ADODB.Connection
   
    'Indicates the name of the provider for the con object
    con.Provider = "Microsoft.Jet.OLEDB.4.0"
    'Opens the connection
    con.Open CurrentDb.Name, "admin", ""
   
    DoCmd.SetWarnings False
    strSQL = "DELETE TagData.* FROM TagData;"
    'Empties the table TagData
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
   
    'Makes a recordset based on the table JournalInfo
    rstJournalInfo.Open "JournalInfo", con, adOpenKeyset, adLockOptimistic
    'Makes another recordset based on the empty table TabData
    rstTagData.Open "TagData", con, adOpenKeyset, adLockOptimistic, adCmdTable
   
    'Run through the table JournalInfo untill the string "Occurancetime:" is met
    Do Until Left(rstJournalInfo!Field1, 14) = "OccuranceTime:"
      rstJournalInfo.MoveNext
    Loop
   
    Do Until rstJournalInfo.EOF
      If Left(rstJournalInfo!Field1, 14) = "OccuranceTime:" Then
            'If "OccuranceTime:" is met store the logTime in strOccuranceTime
            strOccuranceTime = Trim$(Right(rstJournalInfo!Field1, 25))
      End If
      If Left(rstJournalInfo!Field1, 8) = "TagName:" Then
            'Add a new record to rstTagData Alias table TagData
            rstTagData.AddNew
            'If "TagName:" is met store the tagname in strTagName
            strTagName = Mid(Trim$(Mid(rstJournalInfo!Field1, 9)), 2)
            'Insert TagName and LogTime in table TagData
            rstTagData!TagName = Trim$(Mid(strTagName, 1, InStr(1, strTagName, " ")))
            rstTagData!LogTime = strOccuranceTime
            If strOccuranceTime <> "" Then
                'Insert Time in format #DD-MM-YYYY HH:MM:SS# in TagData
                rstTagData!Time = Format(CDate(Left(strOccuranceTime, Len(strOccuranceTime) - 4)), "DD-MM-YYYY HH:MM:SS")
            End If
      End If
      'If "ValueSpecification:" is met enter IF Statement
      If Left(rstJournalInfo!Field1, 19) = "ValueSpecification:" Then
            'Insert Value in table TagData
            rstTagData!Value = Trim$(Mid(rstJournalInfo!Field1, 20))
            If InStr(1, rstTagData!Value, Chr(34)) <> 0 Then
                'If " is present in value cut it of and insert the updated value
                rstTagData!Value = Trim$(Mid(rstTagData!Value, InStr(1, rstTagData!Value, Chr(34)) + 1))
            End If
            If Right(rstTagData!Value, 1) = ")" Then
                'If ) is present in value cut it of and insert the updated value
                rstTagData!Value = Trim$(Mid(rstTagData!Value, 1, InStr(1, rstTagData!Value, Chr(34)) - 1))
                'Row in table TagData is only committed if value is detected
                rstTagData.Update
            End If
      End If
     
      rstJournalInfo.MoveNext
    Loop

    rstJournalInfo.Close
    con.Close
    Exit Sub
   
ErrHandler:
    MsgBox Err.Description
    Exit Sub
   
End Sub

'********************************************************************************************
'This function is called from the macro AuteExec which fires when the SattlineSearcher.mde file
'is opened. Furthermore it calls other functions that transfers information from the Sattline
'Journalfile to SattlineSeacher
'
'ver. 001  RMun    2002-09-04
'********************************************************************************************

Public Function Startup()
On Error GoTo ErrHandler
   
    'Declaration of variables
    Dim objFs As Object

    'Prompts the user to place the Journalfile i c:\ and rename it to journalfile.txt
    MsgBox "Place the extractionfile from Sattline in c:\ and rename it to journalfile.txt!", , "SattlineSearcher"

    Set objFs = CreateObject("Scripting.FileSystemObject")
    If objFs.FileExists(cStrPath) Then
        'If the user have applied the requirements in the msgbox the system will call the
        'function OpenFile.
        MsgBox "After pressing OK SattlineSearcher will analyse the journalfile, " & vbCrLf & _
              "which can take som minutes. Please be patient!", , "SattlineSearcher"
        OpenFile
        DoCmd.OpenForm "frmTextSearch", acNormal, , , , acWindowNormal
        DoCmd.Maximize
        Form_frmTextSearch.cmdShowAll_Click
    Else
        'If the user does not do as specified in msgbox, the startup function will call
        'itself and the user will be prompted with the same msgbox again. The system will
        'keep on doing so untill the requirements in the msgbox are met.
        Set objFs = Nothing
        Startup
    End If
   
    Set objFs = Nothing
    Exit Function

ErrHandler:
    MsgBox Err.Description
    Exit Function

End Function


Som det fremgår kalder Startup også følgende event:

Public Sub cmdShowAll_Click()
On Error GoTo Err_cmdShowAll_Click

    'Declaration of variables
    Dim strSQL As String
    Dim con As ADODB.Connection
    Dim rst As ADODB.Recordset

    Set rst = New ADODB.Recordset
    Set con = New ADODB.Connection
   
    'Indicates the name of the provider for the con object
    con.Provider = "Microsoft.Jet.OLEDB.4.0"
    'Opens the connection
    con.Open CurrentDb.Name, "admin", ""

    strSQL = "SELECT Min(TagData.Time) AS StartTime, Max(TagData.Time) AS StopTime FROM TagData;"
    'Open recordset which holds the first and last logged time in the tabel TagData
    rst.Open strSQL, con, adOpenKeyset, adLockOptimistic
   
    DoCmd.Hourglass True
    'Update the textboxes
    txtStartTime = rst!StartTime
    txtStopTime = rst!StopTime
   
    'Set SQL string to specify all tags fra TagData
    strSQL = "SELECT DISTINCT TagData.TagName FROM TagData;"
    'Update listbox
    lstTags.RowSource = strSQL
   
    'Set SQL string to specify all records in the table TagData
    strSQL = "SELECT TagData.TagName, TagData.LogTime, TagData.Value, TagData.Time " & _
            "FROM TagData WHERE " & _
            "(TagData.Time) Between [Forms]![frmTextSearch]![txtStartTime] And " & _
            "[Forms]![frmTextSearch]![txtStopTime]" & _
            "ORDER BY TagData.TagName, TagData.LogTime;"
                     
    'Update listbox
    lstSelectedTags.RowSource = strSQL
    DoCmd.Hourglass False

    rst.Close
    con.Close

Exit_cmdShowAll_Click:
    Exit Sub

Err_cmdShowAll_Click:
    MsgBox Err.Description
    Resume Exit_cmdShowAll_Click
   
End Sub

Jeg kan ikke se hvad årsagen er til at den siger at den ikke kan finde makroen 'SattlineSearcher.'  !!!
Avatar billede terry Ekspert
19. september 2002 - 12:08 #4
mundt>you can send the dB to eksperten@santhell.dk and I will take a look if you like
Avatar billede mundt Nybegynder
19. september 2002 - 12:24 #5
OK - den er nu sendt.

mvh Mundt
Avatar billede terry Ekspert
19. september 2002 - 12:32 #6
received!
They have an exension (rar) do I just rename to mdb or what?
Avatar billede terry Ekspert
19. september 2002 - 12:35 #7
I think you need to re-send them (zipped) if possible
Avatar billede mundt Nybegynder
19. september 2002 - 13:12 #8
rar er en komprimeret fil ligesom en zip fil. Man skal bare have WinRar til at pakke den ud.

Jeg sender filerne nu som zipfiler.

mvh Mundt
Avatar billede terry Ekspert
19. september 2002 - 14:54 #9
Hi Mundt

I think I have found the problem!

Go into your startup options, you have SattlineSearcher set in as variuos paramaters, also as a startup menu which doesn&#8217;t exist. I have removed all of these and it works now!

I must admit that the error message is misleading
Avatar billede mundt Nybegynder
20. september 2002 - 09:49 #10
Det er rigtigt! På et tidspunkt sad jeg og rodede med noget menu, som jeg så droppede. Jeg har nu ændret boksene til default og det spiller. Og ja, vi kan kun blive enige om at fejlbeskeden er vildledende.

Tak for hjælpen!

mvh

mundt
Avatar billede terry Ekspert
20. september 2002 - 09:54 #11
selv tak
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester