Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Accessing a database remotely using ASP

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google forms auto fill based on text entered. 3 121
Internet Explorer ignoring hyphens in html 1 94
How do I use iTextSharp to turn my current page into a .pdf? 14 702
Timer 6 95
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
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 manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

839 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