Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Accessing a database remotely using ASP

Posted on 2001-06-26
4
Medium Priority
?
154 Views
Last Modified: 2010-04-07
Hello,

I aould like to access an Access 2000 database remotely usign an ASP web page (uses VBScript). Currently I use this code to access a local database :

Set DBCon = Server.CreateObject("ADODB.Connection")
  With DBcon
   .Provider = "Microsoft.Jet.OLEDB.4.0"
   .open server.mappath("database.mdb")
  end with  

Is there any way I can access a database on another server? I tried using a URL in the open command but it didn't work.

Thanks
0
Comment
Question by:Ktoshni
  • 2
4 Comments
 
LVL 3

Expert Comment

by:erikdr
ID: 6227284
Did you mean 'URL' or 'UNC' ?
Basically with UNC (//servername/sharename/database.mdb) it should work, IF...

the process running the ASP has enough credentials to access the remote server. After all its logon is being used,
UNC addressing for a file is quite similar to first running a NET USE and then prefixing the file with a drivelletter.
And of course, //servername  is preferably to be found through DDNS - although you could also use the IP address instead of the name.

Hope thiz helpz,

<Erik> - The Netherlands

0
 

Author Comment

by:Ktoshni
ID: 6227712
No, I want to access the database through a URL if possible since the database is on a server outside the company network
0
 
LVL 7

Accepted Solution

by:
daniel_c earned 300 total points
ID: 6230868
You can't access database through a URL.
It needs the physical path of the database its self.

If it is located on the separate machine, my first try will be using DSN connection.

So, the connection will be like this:
set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "DSN=myDB;" & _
            "Uid=;" & _
            "Pwd=;"


Hope this helps!

^_^
0
 

Author Comment

by:Ktoshni
ID: 6301693
Thanks, sorry I took so long to answer.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question