Solved

Web Server and Database server using ASP connection syntax

Posted on 2004-03-29
8
440 Views
Last Modified: 2008-03-17
Hi there,

I was thinking of setting up a webserver machine and also have a seperate database server machine just for security. My question is, in doing this how would I connect to the datbase on the database server to execute databse scrips? Will I have to assign the databse server a static IP? Also within my connection string (this is sepecific for ASP and Access) what would I write????


<%
Dim conn, strconn
strconn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("        ?????IP ADDRESS??????")
set conn = server.createobject("adodb.connection")
conn.open strconn
%>


Also how could I point to a specific location on the server???

I no the following isnt possible but am thinking on the below lines:

192.245.12.1/c:/db/database.mdb

the IP address is of the machine that hold the db

I hope somebody can help.

Thanks
0
Comment
Question by:Pungwick
  • 4
  • 4
8 Comments
 
LVL 1

Expert Comment

by:chaaser
ID: 10704251
If you want to set up a database server, use a real database like SQL Server (or MSDE) or MySQL. Not some flat-file DB like Access.
For Access, you just need a share to store the .mdb-file on. Then, you cold access that file wih something like
"\\10.0.0.1\sharename\database.mdb".
This is NOT recommended if you want to use the database over a public network (like the internet). If you want to use it in an local intranet, just place the Access file on your file server.
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10705489
so if i wanted to use the database pn a public network what would I do???

i Am mainly concerned with security, i want to show information dynamically from a database and used access as an example. I was think seperating the database from the webserver would allow more security.

So what would you suggest I do, I am more concerned with how I can connect to the database using my asp connection string, thanks

Thanks
0
 
LVL 1

Expert Comment

by:chaaser
ID: 10706751
I'd suggest you give MSDE 2000 or mySQL a try. Both are available for free and come with their own ODBC drivers. Using the ODBC administrator on the web server, you create a system DSN (e.g. named 'webDB') to the database server. In that DSN you can enter hostname, IP address, named pipe or whatever the driver supports.
In ASP, you would then just enter "DSN=webDB" as connection string and let ODBC do the work.
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10706789
Hi,

I am familar with the DNS approach as I am using Oracle as my server and using a connection string is the only why I got asp working with oracle.

thanks
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Expert Comment

by:chaaser
ID: 10706830
So what exactly is the problem? If you are using Oracle and it works with ASP, you should be fine.

You might want to have a look at this site:
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10706867
no the problem is this, currently my webserver machine 'A' holds the database and everything works, but to secure the database content I want to move the datbase to another machine 'B'.

In order to reterive data I wil need to connect to the new machine, so the connetion string will have to change. I was wondering how to connection will change, as I am unfamilar about remote connection syntax.

hope you can help
0
 
LVL 1

Accepted Solution

by:
chaaser earned 35 total points
ID: 10706891
Ah, I see. That depends on the ODBC driver, since the option to specify the database server differs from driver to driver. Have a look at the link I posted before, there you can find different ASP connection strings with their options for several database systems. Oracle is listed there, too.
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10707081
I am currently using the following connection:

SET myConn=SERVER.createobject("adodb.connection")
myConn.Open "Provider=MSDAORA; Data Source=dbname;" & _
"User ID=username;" & "Password=pw"

Where the value Data Source is, if I replace it with the db name everything works, I dont need to give the db a path just the name.

Now I was wondering how could chnage the path so that i could connect to another machine

thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: IanTh
Hi Guys After a whole weekend getting wake on lan over the internet working, I thought I would share the experience. Your firewall has to have a port forward for port 9 udp to your local broadcast x.x.x.255 but if that doesnt work, do it to a …
What’s a web proxy server? A proxy server is a server that goes between clients and web servers, used in corporate to enforce corporate browsing policy and ensure security. Proxy servers are commonly used in three modes. A)    Forward proxy …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

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

21 Experts available now in Live!

Get 1:1 Help Now