borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (myreader problem)Next Topic (sqlDataAdapter) New Topic New Poll Post Reply
AndreaVB Forum : Database : how to share databases
Poster Message
lmh
Level: Whizz Kid

Registered: 31-10-2005
Posts: 18

icon how to share databases

hi!
i hv develop a program using vb6.0 and access as databases. And i package it with Package Deploy wizard.I need install it in diff windows(window xp, win98 and win2000).
my question is how to share the databases. How to do if i want using ODBC? i no any ideas about it. anyone here got any ideas?     

[Edited by lmh on 31-10-2005 at 09:08 AM GMT]

31-10-2005 at 09:03 AM
View Profile Send Email to User Show All Posts | Quote Reply
pavol
Level: Sage

Registered: 11-07-2005
Posts: 68
icon Re: how to share databases

when you package your project you will come to a step where it shows all the objects of your project. there you'll have to add the database files to your project. hope it helps, sry i couldn't explain better.

____________________________
"Intellectuals solve problems, geniuses prevent them."
-Albert Einstein

Pavol

31-10-2005 at 03:48 PM
View Profile Send Email to User Show All Posts | Quote Reply
lmh
Level: Whizz Kid

Registered: 31-10-2005
Posts: 18
icon Re: how to share databases

Hi!
I had add my databases in the steps already. but when i install in more than 1 computer, the databases can't connect together. How can i slove it?

01-11-2005 at 12:42 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to share databases

Hi,
You need to designate one of the PC's as as "File Server" and place the database on that computer. Then put your VB6 App. onto each of the Client PC's and connect them all to the database on the "File Server" PC. That way everyone shares the one database and they all get to see changes made by other users.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

01-11-2005 at 09:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
pavol
Level: Sage

Registered: 11-07-2005
Posts: 68
icon Re: how to share databases

or, you can connect to your database in the Form_Activate procedure using something like:
App.Path & "\Databases\yourdatabase.mdb".
in your connection string. this will connect to the database as long it's in your program's directory and the Database subfolder.

____________________________
"Intellectuals solve problems, geniuses prevent them."
-Albert Einstein

Pavol

01-11-2005 at 03:51 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to share databases

Hi,
Sorry pavol, but that wont work for him - that will only connect the LOCAL app to the LOCAL database. What lmh needs to do is set the connection string to the centralised database on the FileServer PC

strPath = "\\servername\foldername\databasename.mdb"
strCNN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & ";Persist Security Info=False;Jet OLEDB:" _
& "Database Password=password_if_set"
Set cnn = New ADODB.Connection
cnn.Open strCNN



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

01-11-2005 at 04:09 PM
View Profile Send Email to User Show All Posts | Quote Reply
pavol
Level: Sage

Registered: 11-07-2005
Posts: 68
icon Re: how to share databases

sry about that, my mistake

____________________________
"Intellectuals solve problems, geniuses prevent them."
-Albert Einstein

Pavol

01-11-2005 at 04:21 PM
View Profile Send Email to User Show All Posts | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: how to share databases

I agree with GeoffS idea. You must have a dedicated server where to put your database and can be accessible to all workstation. You must share the folder or map it in the network where your database resides.

____________________________
Im JAMES  

02-11-2005 at 01:44 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: how to share databases

Hello. My two cents:

speaking about install matters, I suggest you to set a system to intercept any "No database found" error. This way, at your first run, you can give user the ability to select an appropriate db, and store the path into an external INI file.
From now on your application can load the db path from the INI file at each startup. You could also give user the feature to select another db everytime he wants, e.g. by a menu voice. This way you can even manually change the path into the INI file, without affecting your app code.
If you dont' want to enable user to choose the db, you can instead include the INI file setting feature - and even the server mapping feature as well - in the setup process. I usually create a small executable that does all these simple tasks, and then launches the real setup file.

Speaking about runtime matters, you can of course read your db from several client machines at the same time, but you should set a lock system to manage the contemporary writing attempts. This because if two or more users try to edit the same record at the same time it can raise an error. You should prevent this by setting the LockType property.

Hope it helps.

____________________________
Real Programmer can count up to 1024 on his fingers

02-11-2005 at 09:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
VYX
Level: Professor


Registered: 16-12-2005
Posts: 70
icon Re: how to share databases

HI...

I ALSO CREATE A SYSTEM THAT WILL ACCESS THE DATABASE STORED IN THE DATABASES [ CENTRALIZED SYSTEM]  

IN ORDER THAT THE CLIENT TERMIANAL CAN ACCESS THE SYSTEM YOU CAN SHARE THE FILE [RIGHT CLICK THE FOLDER YOU WANT TO SHARE,SELECT PROPERTIES,SHARING TAB, CLICK THE CHECKBOX ALLOW SHARE THIS FOLDER ON THE NETWORK,CHECK THE ALLOW USER TO CHANGE MY FILE IF YOU WANT THAT THE USER CAN MAKE CHANGES TO YOUR FILE]

AND DO THE SUGGESTION OF MR GEOFFS ...


AND YOUR SYSTEM WILL WORK..


=SHARE UR KNOWLEDGE AND LEARN OTHER KNOWLEDGE=

22-12-2005 at 09:10 AM
View Profile Send Email to User Show All Posts | Quote Reply
xtramac
Level: Professor


Registered: 28-08-2005
Posts: 89
icon Re: how to share databases

hey imh,

just a reminder... so that you wont be asking again... i got this answer from this forum also..

there is a limit on the number of users that can access your MSACCESS db cuncurrently... only 10 cuncurrent user access is allowed so be carefull not to overload it.. otherwise you have to use MSSQL Server..

andrew

29-12-2005 at 08:40 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to share databases

Hi,
QUOTE:- only 10 cuncurrent user access is allowed

I don't want to be pedantic, but that is not quite correct. There is NO LIMIT EMPOSED on connections to MSAccess in terms of what is "allowed". BUT - it is recommended by Microsoft that if you are going to have much more than 10 connections that you should upgrade to SQLServer or MSDE (now SQLServer Express in the 2005 version).
I have had up to 20 connections to Access working, and although it obviously slowed down the data retrieval times it still worked OK. A lot depends on how big the database becomes. A small database of a few hundred Customer Names and Orders will not be too much of a problem, but a database containing several thousand records is.
Having said all that, if you have the slightest doubt as to whether or not Access will cope then go for MSDE(SQLExpress) - the advantage there is that IF it does get REALLY BIG, then you can upgrade to the full SQLServer without having to re-write the database or your code.



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

09-01-2006 at 12:27 PM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: how to share databases

quote:
GeoffS wrote:
Hi,
QUOTE:- only 10 cuncurrent user access is allowed
....
There is NO LIMIT EMPOSED on connections to MSAccess in terms of what is "allowed"....
Hello. I spoke about this many other times. The main leak of Access is its query execution.
Access executes the queries in the local machine, while other db engines execute the queries on the server. So, as the server side method is faster (due to better performances of server machines and a reduced network traffic) other engines are more indicated to multi-user db usage.

There is no limitation on the concurrent users amount, and we can even connect a thousand users together, even with a huge db, and that could have no effect on db performances. The limit is given by the queries frequency.
Each query is slower in Access, but if you execute one at a minute, you can keep connected a lot of users together without any system slowdown. Say, if you have a password authentication archive, you can even keep a thousand users connected together, as it would be hard that everybody will send his authentication request together with another. The maximum concurrent log would be half-a-dozen users in the same millisecond, and this situation won't be frequent. In the school I work in we manage about 1500 users, and their password are stored in an .mdb file on a server. It works fine since eight years, as that server receives an average log request every ten seconds, so it perfectly fits its requirements.
Of course, the other dbs are not .mdb, but they are requested to execute queries much more often.
quote:
BUT - it is recommended by Microsoft that if you are going to have much more than 10 connections that you should upgrade to SQLServer or MSDE (now SQLServer Express in the 2005 version).
Now, I agree up to a point: MSDE does have a limitation on five users. It means that the sixth client will be ignored, even if the cable is free of traffic and the server is idle since one hour. I hardly believe that Microsoft itself would suggest to switch to MSDE if you have more than 10 users. No doubt for SQLServer.

quote:
A lot depends on how big the database becomes.
Again, it's not the size but queries' frequency that affects performances.

quote:
....if you have the slightest doubt as to whether or not Access will cope then go for MSDE(SQLExpress) - the advantage there is that IF it does get REALLY BIG, then you can upgrade to the full SQLServer without having to re-write the database or your code
Well, it's not hard the conversion from Access to SQLServer too. Access files are fully compliant to SQLServer, just choose "Import" on the database and you can pass your data to the SQLServer by every MSAccess file.
Then, differences will be in the SQL dialect, in administrative tools, in stored procedures, all new things that we have to learn, but the two programs can easily exchange data. The only fail I noticed is on the Keys exportation, but if I remember to check them when importing the tables' structure I hadn't noticed any misworking.

Access or SQLServer? We have to choose according to db accesses' amount we think we'll have. Period. MSAccess is fully usable - and it is largely used in fact - for multi-user purposes, for VB-interfaced applications or for standalone (Access read) archives, or whatever.

It's not my way to take part of MS products, but in this case they did the minimum requested feature to their products: a full compatibility among them (it's not always obvious with MS...)
Hope it helps


____________________________
Real Programmer can count up to 1024 on his fingers
09-01-2006 at 06:47 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: how to share databases

Hi,
My tuppence-worth.. if you write your application with a view towards MSDE.. the migration path towards a proper DBMS is incredibly easy... I would recommend this if possible.
Regards,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

10-01-2006 at 12:05 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to share databases

OK yronium, I asked for that by saying I was not going to be pedantic. What I was trying to get across - but without being TOO technical - was exactly what Kieron says. I mentioned MSDE in with the generalised quote from Microsoft despite the 5 user limit. MS actually state the full SQL Server version but this advice was issued before SQLServerExpress 2005 was released - there is no such limit on this version, only an overall DB size of 2Gb. on a 1 processor PC. So, as Kieron states, write with SQLServer in mind 'cos code and data access methods will need to be changed if you start with Jet/MSAcccess.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

10-01-2006 at 10:48 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: how to share databases

quote:
GeoffS wrote:...So, as Kieron states, write with SQLServer in mind 'cos code and data access methods will need to be changed if you start with Jet/MSAcccess.
I agree: write with SQLServer in mind. Or, at least, write with a pro dbms in mind. My intervention was directed to the ones who don't have SQLServer, nor the old MSDE (it actually has the 5 users limit. I'm working on a MSDE project at the moment). I only meant to explain to Access db users the limits they have to front. Of course, if they can, they should move to SQLServer in order to improve performances.
Hope it helps


____________________________
Real Programmer can count up to 1024 on his fingers
10-01-2006 at 02:14 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to share databases

And just one more point - for those that use Access and perhaps are not aware, MSDE and SQLServerExpress are available as FREE downloads from Microsoft, plus with SQLServerExpress there is also a really good Free Management tool to administer your databases. The downside to that, of course, is that you need the DotNet Framework Version 2 to run SQLServerExpress.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

10-01-2006 at 04:32 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : how to share databases
Previous Topic (myreader problem)Next Topic (sqlDataAdapter) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder