Solved

Web Server and Database server using ASP connection syntax

Posted on 2004-03-29
8
484 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
[X]
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
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Blocking outside IP Addresses 16 130
Outlook PST (cloud) backup 3 88
external website is 16 41
setting up a Ubiquiti access point 3 24
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.
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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