Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8089827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:31:42+00:00 2026-06-05T19:31:42+00:00

Please tell me there is a better solution to querying a remote Access database!

  • 0

Please tell me there is a better solution to querying a remote Access database!

We are currently using this because thus far we have failed at hooking up a sp_linkedserver. I feel like it’s a terrible hack and want to be done with this whole network mapping business once and for all!

    'This is for access 2007
    'DataBase on Local Machine
    '*************************************************************************************************
    'Before a conneciton is made this code sends the credentials to the remote path.
    Dim objNetwork As Object
    objNetwork = Microsoft.VisualBasic.CreateObject("WScript.Network")
    'this line below deletes the drive if there is one so that a correct mapped drive can be created
    'objNetwork.RemoveNetworkDrive("W:")
    Dim DriveLetter = "W:" ' *** This drive needs to be deleted after it is created see the end of this sub for deletion
    Dim RemotePath = "\\volume10\pickles\toads\rocks\sheepy\almostTodb\behindTheScenes"
    Dim UserID = "sysama01\starUser"
    Dim UserPWD = "secretPass"
    objNetwork.MapNetworkDrive(DriveLetter, RemotePath, False, UserID, UserPWD)
    'Syntax()
    '****.MapNetworkDrive(strLocalDrive, strRemoteShare, [persistent], [strUser], [strPassword])
    'Options:
    'strLocalDrive  : The drive letter (e.g. L:)
    'strRemoteShare : The UNC path to the remote drive \\MyServer\MyPrinter
    '(String value)
    'persistent     : True/False - store the mapping persistently in the users profile
    'default = false
    'strUser        :  The user name. (Optional)
    'strPassword    :  The password. (Optional)
    ' Location for code http://ss64.com/vb/drivemap.html
    '*************************************************************************************************
    'DataBase on Network Drive
    objConn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=W:\SuperDeliciousFoodDB.accdb;Jet OLEDB:Database Password=databasePasswordHere")
    'DataBase on Network Drive
    objConn.Open()
    objCmd = New OleDbCommand("SELECT * from pancakeTable, objConn)

    objReader = objCmd.ExecuteReader
...
'Do more codestuffs here
objNetwork.RemoveNetworkDrive("W:")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:31:43+00:00Added an answer on June 5, 2026 at 7:31 pm

    I would suggest migrating data onto SQL Server. If you use the linked tables option, you can continue to use the forms, reports and queries in your existing Access db, while still being able to query the data remotely, from as many connections as you can.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please conform if I am correct and tell me whether there is a better
Please review my brief example code below and tell me if there is better,
Can anyone please tell me is there any special requirement to use either EXTERN
Can someone tell me how to change directories using FtpWebRequest? This seems like it
Please tell me what is the Qt equivalent function for glutswapbuffers()..
Please tell me why my window doesn't render. Below is the javascript that i
Please tell me if it is possible to do the following: create an instance
Please tell me what will the call to given function return and how? The
Please tell me how to validate GUID in .net and it is unique for
please tell me how to get and bind data to UltraGrid dynamically on each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.