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

x
?
Solved

Web Server and Database server using ASP connection syntax

Posted on 2004-03-29
8
Medium Priority
?
506 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
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
 
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 140 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Make the most of your online learning experience.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

963 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