Solved

Web Server and Database server using ASP connection syntax

Posted on 2004-03-29
8
474 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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…

828 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