How can I make ONE database be updated from multiple terminals connected through a LAN network? How can I access the database through a LAN network in visual Basic 6?

Dani AI

Generated

Short answer: use a central database server and have each VB6 client talk to it over the LAN (recommended), or use a shared Access file only for very small, low-write setups. ’s goal (one canonical dataset visible to multiple terminals) is exactly the situation a server-based DB solves — it gives you transactions, locking, concurrency control and easier backups. pointed toward a server/client model; building your own Winsock protocol is possible but usually reinvents functionality the DB server already provides.

If you must use Access 2003 (as mentioned), place the .mdb on a reliable server share, use UNC paths (\SERVER\Share\Database.mdb) from VB6, set share/NTFS permissions so clients can read/write, and keep automatic compact/repair and backups in place. Access is fine for a few simultaneous users; it gets fragile under many concurrent writers or flaky networks. Credit to : sharing the folder is the simplest route, but it’s a stopgap rather than a scalable solution.

Practical VB6 patterns (ADO, DSN-less preferred) and example connection strings:

' Access 2003 (.mdb)
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\SERVER\Share\Repairs.mdb;Persist Security Info=False;"

' SQL Server (recommended for multiuser)
cn.Open "Provider=SQLOLEDB;Data Source=SERVER\SQLEXPRESS;Initial Catalog=RepairsDB;Integrated Security=SSPI;"

Use transactions and parameterized commands, and always roll back on error:

cn.BeginTrans
cmd.CommandText = "UPDATE Repairs SET Status=? WHERE RepairID=?"
' set parameters on cmd, then cmd.Execute
cn.CommitTrans

Operational tips: prefer a server DB (SQL Server Express/MySQL/Postgres) for reliability; avoid mapped drive letters (use UNC); enable SQL Server remote connections and open its port (or SQL Browser for named instances); use DSN-less connections so you don’t have to configure ODBC on every client; and test under expected concurrent load. If offline editing or distributed sites are required later, look into proper replication/synchronization rather than ad-hoc file copies.

Recommended Answers

All 7 Replies

You can use server and client system. Database you want to update will be in Server PC and use winsock to update data at server.

what is the database that you want to use over LAN ?

debasisdas: lets say its a database that holds records of repaired computers in a service centre. The service centre is connected to the computer shop with a LAN connection. So when the people in the service centre changes information in the database, it needs to be updated in the shop as well. In other words, the shop needs to know the status of computers in service centre, whether they are repaired or not.

I was asking about the database that you are using (access, sql server, oracle etc) not the contest of your database.

If the database is Access then all you have to do is Share its folder and make it writable so it can be access through lan connection...

debasisdas my database is Microsoft Access 2003.. I also want to update to update my database in one server since it is connected to multiple terminals. I need a solution for this problem for my thesis project. :(

Joshua, this thread is more than a year old. Please open your own thread from HERE. We will gladly help, just not from here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.