-
October 7th, 2002, 01:10 AM
#1
Connect Access on remote server using ADO
Hi All,
I am using VB6 and access 7.What will be connection string if i want to connect access database which is not on the local pc but at remote server using IP Address of that server with out using DSN.
Thanks in advance.
Jignesh
-
October 7th, 2002, 01:21 AM
#2
ADO supports network paths, so it is possible to do something like this:
Code:
cnn.open "Provider=Microsoft.Jet.OLEDB.4.0;data source=\\192.168.0.1\someshare\mydatabase.mdb;"
-
October 7th, 2002, 02:03 AM
#3
Thanks for your prompt reply.
Jignesh
-
October 7th, 2002, 04:26 AM
#4
Hi,
Thanks for your reply that seems to be working fine but now how to supply password for the access database and password for accessing remote server both in same connection string.
Or if not in same connection string then is there any way to pass both the password.
Jignesh
-
October 7th, 2002, 05:56 AM
#5
I believe the authentication that would be in that connection string would be used solely to log into the database. If you need to authenticate the share, you must map the drive in a preceeding connection string.
-
April 5th, 2011, 09:16 AM
#6
Re: Connect Access on remote server using ADO
Hey
thanx but I was wondering where is that "someshare"
Suppose I have my database in c:\aj\database.mdb , then how would taht data source change?
It would be helpful if you could let me know.
Thank you
Originally Posted by Cakkie
ADO supports network paths, so it is possible to do something like this:
Code:
cnn.open "Provider=Microsoft.Jet.OLEDB.4.0;data source=\\192.168.0.1\someshare\mydatabase.mdb;"
-
April 5th, 2011, 03:04 PM
#7
Re: Connect Access on remote server using ADO
This needs to be done in two stages.
Firstly you need to have permission to the network share. This can be easily done by opening the shared folder in Windows Explorer or via Network Neighbourhood. When you are asked to supply a username / password make sure that you tick the box to remember password.
You can also map this network share to a drive letter but you must set it to reconnect at next logon.
Your code to open the Access database woud be
DAO
Code:
Set db = DAO.OpenDatabase("\\192.168.0.1\SHARENAME\Database.MDB", False, False, ";pwd=LetMeIn")
ADO
Code:
cnn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\192.168.0.1\SHARENAME\Database.MDB;Jet OLEDB:Database Password= LetMeIn"
In the above examples....
192.168.0.1 is the IP address of the server
SHARENAME is the network share name of the shared folder containing your Access database.
Database.MDB is the Access database filename
LetMeIn is the Access database password
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|