Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect to an Access 2000 db on another computer 1

Status
Not open for further replies.

iown714

IS-IT--Management
Aug 2, 2005
8
US
Hi,
I'm trying to write just a simple VB application that runs on machine X and accesses an Access table on machine Z. I don't really want to map any drives or such thing. Machine X and Z are in the same network so they can see each other. Does anyone know what the connection string would be for the application to access the table?

Let's say that I want to retrieve all records whose customers whose first name is = "mark". The basic structure to open a db is...

Set dbsCurrent = OpenDatabase("xxxx")

... and then what??? what is the next thing that I have to do to get all the records from machine Z to machine X? What is the exact connection string that I have to use in order to access an Access database over the network?

Thank you in advance.



 
Assuming you shared the folder correctly on machine Z, you can use the absolute path to the database just like you would on your local machine.

For example:

Code:
Set dbsCurrent = OpenDatabase("\\machineZ\data\myDatabase.mdb")

You should of course replace 'machineZ\data\...' with the correct path and filename, where machineZ is the name of the machine you are connecting to.

 
Ruffnekk,
thanks for ur earlier response. i just have one last question. i used Access 2000 to creat the table as such it is formatted with Access 2000 "stuff". When I do

Set dbsCurrent = OpenDatabase("C:\data\myDatabase.mdb")

I get an error message that says:

"Run-time error '3343', unrecognized database format C:\data\myDatabase.mdb"

However when i convert the table to an older Access version, like Access 97, the program is able to open the table correctly? have you seen this before? this is very odd, i don't understand why when using Access 2000 to create a table and using the string above i get that error message but when i convert, always using Access 2000, the table to an earlier version of Access then i don't get the error. I have VB 6.0 with Visual Studio 5 SP 6 installed and also Office 2000 SP3 installed. Also in the VB workspace under Project -> References, i already have the Microsoft DAO 3.51 object library checked but i still get this message. do you know if i'm supposed to add some more References in my VB application or if i need to install some other hotfixes? Thanks!!!
 
To work with Access 2000 databases, you have to have Microsoft DAO 3.6 object library or higher at least.

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top