Solved

Web Server and Database server using ASP connection syntax

Posted on 2004-03-29
8
480 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

Suggested Solutions

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

680 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