Sad Der
accessd666 at yahoo.com
Thu Jan 22 03:23:36 CST 2004
Hi, i already timed every proces. here are the results: Proces Time Switch 10 seconds Stam 21 seconds Verhuis 27 seconds CI 94 seconds So the CI is a big one. On the other hand, the other processes also take up a lot of time! SD --- Andy Lacey <andy at minstersystems.co.uk> wrote: > Sander > The first thing I suggest you do is put timing code > in to isolate where you > have performance issue(s). If you don't already have > something I can send > you a copy of JC's timer class (I'm sure he won't > mind). There's no point > aiming attention at one routine only to find that it > represented 0.01% of > the overall time. So, first up, find the lines of > code which are doing the > damage. > > Andy Lacey > http://www.minstersystems.co.uk > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On > Behalf Of Sad Der > > Sent: 22 January 2004 06:26 > > To: Access Developers discussion and problem > solving > > Subject: RE: [AccessD] Major Performance Issue! + > Code > > > > > > Here is (part of) the code: > > PS: I found the GetMaxDate() function, I think on > wolfwares.com! > > > > > '============================================================= > > ============================ > > ' Function Name : FillStamMeetProces > > ' Parameters : No parameters > > ' Return value : (String) <MEANING> > > ' Purpose : <PURPOSE> > > ' Assumptions : --- > > ' Uses : --- > > ' Created : 2003-10-24 10:12, SaDe > > ' Modifications : > > > '============================================================= > > ============================ > > Function FillStamMeetProces(strProces As String) > As > > String > > '150 StamMeetData > > '210 StamMeetData > > Dim strMeD As String 'Message_date > > Dim strSQL As String > > Dim strRecordcount As String > > > > On Error GoTo FillStamMeetProces_Error > > Select Case strProces > > Case "SM" > > 'Cleanup table > > DeleteRecords strProces > > > > '---------------------------------------- > > ' 150 Te verwerken ontvangen > stamgegevens > > '---------------------------------------- > > > > > '--------------------------------------------------------- > > 'MaxDate() > > > > > '--------------------------------------------------------- > > strSQL = vbNullString > > > > 'SQL statement to fetch most recent date > > strSQL = "SELECT Max([Bericht 150 (Update > Master > > Data)].Message_Date) AS MaxOfMessage_Date " & _ > > "FROM [Bericht 150 (Update Master > > Data)] " & _ > > "WHERE Connect_EAN =" & "'" & > > gstrSelectedEan & "' " > > > > strMeD = GetMaxDate(strSQL) > > If Len(strMeD) = 0 Then > > strMeD = "N/A" > > End If > > > > > '--------------------------------------------------------- > > 'Aantal Records > > > > > '--------------------------------------------------------- > > strSQL = vbNullString > > 'SQL statement to fetch most recent date > > strSQL = "SELECT COUNT(*) " & _ > > "FROM [Bericht 150 (Update Master > > Data)] " & _ > > "WHERE Connect_EAN =" & "'" & > > gstrSelectedEan & "' " > > > > strRecordcount = GetRecordCount(strSQL) > > > > 'Check if a date was returned > > If strRecordcount = vbNullString Then > > strRecordcount = "0" > > End If > > > > 'Create new record > > AddRecords strProces, "150", strMeD, > > strRecordcount > > > > '---------------------------------------- > > ' 210 Te verwerken ontvangen meetdata > > '---------------------------------------- > > > > > '--------------------------------------------------------- > > 'MaxDate() > > > > > '--------------------------------------------------------- > > strMeD = vbNullString > > strSQL = vbNullString > > 'SQL statement to fetch most recent date > > strSQL = "SELECT > Max(V2_210_MEDTD1.message_date) > > AS MaxOfmessage_date " & _ > > "FROM V2_210_MEDTD1 " & _ > > "WHERE Connect_EAN =" & "'" & > > gstrSelectedEan & "' " > > > > strMeD = GetMaxDate(strSQL) > > If Len(strMeD) = 0 Then > > strMeD = "N/A" > > End If > > > > > '--------------------------------------------------------- > > 'Aantal Records > > > > > '--------------------------------------------------------- > > strSQL = vbNullString > > 'SQL statement to fetch most recent date > > strSQL = "SELECT COUNT(*) " & _ > > "FROM V2_210_MEDTD1 " & _ > > "WHERE Connect_EAN =" & "'" & > > gstrSelectedEan & "' " > > > > strRecordcount = GetRecordCount(strSQL) > > > > 'Check if a date was returned > > If strRecordcount = vbNullString Then > > strRecordcount = "0" > > End If > > > > 'Create new record > > AddRecords strProces, "210", strMeD, > > strRecordcount > > Case Else > > MsgBox "UNKNOW PROCES!" > > End Select > > > > FillStamMeetProces_Exit: > > ' Collect your garbage here > > Exit Function > > FillStamMeetProces_Error: > > ' Collect your garbage here > > Call > > g_oGenErr.Throw("Switchdatabase.mMultiInterface", > > "FillStamMeetProces") > > End Function > > > > Function GetMaxDate(strSQL As String) As String > > 'Dim strSQL As String > > Dim conn As ADODB.Connection > > Dim rstBericht As ADODB.Recordset > > Dim strMaxDate As String > > > > Set conn = CurrentProject.Connection > > Set rstBericht = New ADODB.Recordset > > > > > > With rstBericht > > .ActiveConnection = conn > > .CursorType = adOpenKeyset > > .LockType = adLockReadOnly > > .Source = strSQL > > .Open > > If .RecordCount > 0 Then > > If IsNull(.Fields(0)) Then > > strMaxDate = vbNullString > > Else > > strMaxDate = .Fields(0) > > End If > > Else > > strMaxDate = vbNullString > > End If > > End With > > > === message truncated === __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/