Solved

Accessing a database remotely using ASP

Posted on 2001-06-26
4
142 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 100 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now