|
-
Nov 6th, 2012, 09:04 AM
#1
Re: VB6 with Access in Local Network (LAN)
Well with a database that size, first thing I'd do is reconsider using something else other than Access... the next thing I'd do is check the code where you are selecting data... are you running queries like this? SELECT* FROM SOMETABLE .... with no where clause? If you are... don't. you should only be selecting the cols you need, and only the rows you need... otherwise all of that data has to come down over the network. That would be the next thing to look at... network traffic... how stable it the network? blah, blah blah...
-tg
-
Jan 19th, 2013, 06:42 AM
#2
Thread Starter
Junior Member
Re: VB6 with Access in Local Network (LAN)
I see some programms.. that working properly and it use same exe for node and server... its working same speed in node and server... how can i write an same exe for node and server.
-
Jan 19th, 2013, 02:32 PM
#3
Re: VB6 with Access in Local Network (LAN)
 Originally Posted by sha123
I see some programms.. that working properly and it use same exe for node and server... its working same speed in node and server... how can i write an same exe for node and server.
I have made programs VB6.0 + Access (database) that run for years in multi-user (LAN and Terminal Server) without any problem. Some even with 15 concurrent users.
My suggestions here:
1)
This problem is due to cache updating, that in JET has been changed. The default time refresh occur each 5 minutes.
Therefore, if you read data immediately after updating, the data seem no changed.
You need to force the refresh of the cache after each UPDATE or INSERT SQL command (or ADODB.Recordset Update methods, also):
Code:
' note that Microsoft Jet And Replication Objects Library 2.6 need installed.
' library file: MSJRO.DLL (however already installed on most of systems)
'
' CN is the ADODB.Connection
Dim Jet As Object
On Error Resume Next
Set Jet = CreateObject("JRO.JetEngine")
If Not Jet Is Nothing Then
Jet.RefreshCache CN
End If
After refresh cache, you get the updated data immediately.
I.e., to get the ID set as counter field (Autoincrement) for last added record:
Code:
First use the above code, then inquire to get the new ID
Set rs = CN.Execute ("SELECT @@IDENTITY AS newID FROM MyTable")
2) you do not need to use Winsock to access the data.
3) In multi-user environment it is necessary to implement a strong control about concurrency. See:
Using Optimistic Concurrency
http://msdn.microsoft.com/en-us/libr...cz(VS.80).aspx
4) Wher INSER or UPDATE data, use always Transactions!!!
5) Compact and Backup database every day.
You can downlaod my project that contains a complete application-template (starting from LOGIN) where you can see many of above feature.
I use classes to access database (Get and Save methods)
Unfortunately for you, my page is on italian language, but the source code is VB6.0. 
http://nuke.vbcorner.net/Progetti/VB...T/Default.aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|