Re: Timer event not firing, and unpredictable slowdowns in code.
- From: <know.thyself_no.spam@xxxxxxxxxxx>
- Date: Wed, 14 Nov 2007 01:56:36 -0500
Thanks, that's helpful code. So far, I've managed to de-multi-task most of my code and that solved much of the problem, but it still seems that it appears in odd places. For example, one simple Access query--select the top two records by descending primary key order where another field is equal to a certain value--slows down *extremely* (we're talking one second jumping to three minutes) as the cpu gets faster and number of cpus increase--is it possible one basic access query can result in thread collisions?
(And I haven't figured out why one database is increasing in size automatically and dramatically even when no editing is taking place--a zombie database.)
"Rich P" <rpng123@xxxxxxx> wrote in message news:4738e6a4$0$504$815e3792@xxxxxxxxxxxxxxxxx
Note: Access is probably the most powerful micro RDBMS on the market
today (and probably has been since the beginning). But you can only
cram so much functionality into a Micro system -- in particular -- an
integrated database/development platform like Access.
The advantage of Access is that it can be used by non-programmers
through expert progragmmers, where .Net you need to already be very
proficient in OOP to take advantage of a lot of the features.
One nice thing with .Net to Access is that a dll can be created in .Net
which can be invoked in Access. This would be the workaround to your
issue.
Here is a snippet of code that uses delegates for a slideshow app I
wrote a few years ago in VB2005
-------------------------------------------------------
Public Delegate Sub StartSlideShowDelegate()
Private Delegate Sub ShowPicsDelegate(ByVal PicCount As Integer, ByVal
str2 As String)
Private Sub ShowPics(ByVal PicCount As Integer, ByVal str2 As String)
Try
If Me.InvokeRequired Then
' if operating on a thread, invoke a delegate
' on the UI thread.
Dim omd As ShowPicsDelegate = New ShowPicsDelegate(AddressOf
ShowPics)
Dim arx As IAsyncResult = Me.BeginInvoke(omd, New Object()
{PicCount, str2})
Me.EndInvoke(arx)
Return
End If
If PicCount > 580 Then
Console.WriteLine(PicCount.ToString & ") " &
arrPics(PicCount).ToString)
End If
PicImage.Image = New Bitmap(arrPics(PicCount).ToString)
Me.Text = str2 & " " & arrPics(PicCount).ToString
lblPicCount.Text = (PicCount).ToString
Catch ex As Exception
Me.Text = str2 & " " & arrPics(PicCount).ToString & " Error: This
image not viewable"
lblPicCount.Text = (PicCount).ToString
End Try
End Sub
-------------------------------------------------------
A delegate is basically an Interface for Subs and Functions. And an
Interface is an abstract class that defines the structure of regular
classes, and this is significant when writing .Net DLLs for Com usage
(Access is a Com based program -- component object model -- old school
programming). The nice thing is that you can take advantage of the
functionality of .Net from within Access, although, I did have a
problem trying to use ADO.Net from within Access through a .Net DLL I
wrote. The problem ended up being some legal thing between Microsoft
and the world and for some reason they restricted ADO.Net from Access --
but not from Excel - my ADO.Net dll worked in Excel -- go figure)
VB.Net is basically a cross between C++ and VB (not sure if it is
recognized by the AKC yet). So you definitely need to be up on OOP to
take advantage of VB.Net. You probably don't need to be up on C++
programming to use VB.Net, but if you really want to get into the guts
of OOP, I would recommend a course in C++. And delegates is definitely
at the core of OOP.
Rich
*** Sent via Developersdex http://www.developersdex.com ***
.
- References:
- Re: Timer event not firing, and unpredictable slowdowns in code.
- From: know.thyself_no.spam
- Re: Timer event not firing, and unpredictable slowdowns in code.
- From: Rich P
- Re: Timer event not firing, and unpredictable slowdowns in code.
- Prev by Date: Re: Access Input Mask Code
- Next by Date: Re: Help Needed With DCount
- Previous by thread: Re: Timer event not firing, and unpredictable slowdowns in code.
- Next by thread: Columns into row
- Index(es):
Relevant Pages
|