Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2004, 05:20 PM
Authorized User
 
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Use VBA to get data from Access (Share folder)

Hello,
I have an Access db and need to get some tables from another Access db in a shared folder. I want to get the tables via VBA. I have the IP address of the location of the file. I was informed to use UNC (UNC ?).
HELP !
 
Old April 23rd, 2004, 12:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One way is to simply map a network drive letter to that folder then you can treat it as if it were a local file and link/attach to it like you would any other MDB table.

Hope this helps, Mitch
 
Old April 23rd, 2004, 12:56 PM
Authorized User
 
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply. I did the following

1. mapped a network drive letter to that folder
2. used the docmd code below to import the tables

DoCmd.TransferDatabase acImport, "Microsoft Access", "\\XXX.XX.X.XXX\D$\ACCESSDB.mdb", acTable, "txb1", "tbl1"



 
Old April 28th, 2004, 12:02 AM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Skipmeok Send a message via MSN to Skipmeok
Default

A UNC address is similar to an IP address, but easier, and safer to use. Like for example on the WWW, when you enter www.yahoo.com, a DNS (Domain Name Server) translates www.yahoo.com into 216.109.127.30, and connects you to Yahoo.com. A UNC address is a Universal Naming Convention for a local computer within your companies network. So in your application you could use the following:

\\<computer name where file resides>\<drive letter>\<folder name>\<file name> for example:
\\mycomputer\D$\myfolder\mybd.mdb could be a valid UNC address.

This way, if the computer uses a DHCP server to obtain an IP address, you will never have to worry about losing the connection because, although the IP address may change, it is almost impossible to change the UNC address. Use the UNC address whenever possible.



Skipmeok
 
Old April 28th, 2004, 07:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Another way the UNC is better than a drive letter is that different computers may connect to the same network drive via a different drive letter. Your J: drive may be someone else's Q: drive. The letter is arbitrary. The actual network address is not. Using the UNC insures that both computers are referring to the same folder in the same network drive.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old April 28th, 2004, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just wondered what the $ is doing in
\\mycomputer\D$\folder etc ?
I have sometimes used just the drive letter without problems.

Clive Astley
 
Old April 28th, 2004, 10:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

$ is used along with Drive letter only when you try to access the drive of the remote system with the Administrator privilege

You cannot access the Drives with $, using any other user privilege.

It is called the Hidden share.

Cheers!

-Vijay G





Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Network Share with Access VBA JonniP Access 15 January 5th, 2007 01:57 PM
hot access to a share folder in asp.net vsraja Excel VBA 0 June 5th, 2006 01:43 AM
how to share a folder or a file on the internt asimmehtab Pro VB 6 1 December 31st, 2004 07:38 AM
Use VBA to get data from Access (Share folder) ckentebe Access 1 April 21st, 2004 06:23 PM
how to share a folder mqnguyen Classic ASP Basics 2 August 6th, 2003 01:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.