Question:
I want to connect to an Access DB on a server from a client using a VB app. I assume I would have to make a connection to the database on the server. How could I do this? Would I need to return a recordset from the sever via ADO?
Answer:
For Access, you have to specify a directory and filename in your ADO connection string. That means that the directory where the file is located needs to be mapped as a network drive on your computer. Once you’ve done that, you can create your connection string like this:
Dim cnDB As New ADODB.ConnectioncnDB.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Data Source=F:MyDB.mdb"cnDB.Open
You can then get recordsets or whatever else you need from the database. If you’re using Access 97, use OLEDB.3.51 instead of OLEDB.4.0 in the connection string.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























