Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tf7080
Starting Member
1 Post |
Posted - 2009-08-21 : 04:42:06
|
| Hi guys,I'm very new to SQL databases and microsofts SQL Server 200* softwares, however it is my task to do some modifications to the workflows on a company website that i'm working for!I want to know if its possible, and I'm thinking it definately is, to access the data in a SQL Server database hosted on another server, for use in a website, using ancient ASP code?I say that I think it must be possible because, the current implementation of the website is run on a different server to the one that the SQL database is hosted...I'm trying to run a copy of the site on my own machine for development purposes: I have an XP machine with IIS installed, also have SQL Server 2005 installed and currently doing nothing. I can display the site on my machine and it looks and functions fine, just without the database access, because i had to comment out, as it was giving an error. That error being...Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80004005)[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied./asp/db.asp, line 14And the code on Line 14 that caused it... oConn.Open( "Driver={SQL Server};Server=91.150.238.50;Database=tomlin;Uid=usr;Pwd=pass;" )Now i'm not sure if I need to have SQL Server installed on my pc and somehow connected to that server to access the database that way, or if I have to access the server with the database and add an exception to allow me to access it remotely from my PC?I have no idea, plus i'm partly worried about disrupting something and mucking up the live site!Remember I have full access to both the server with the live site code and the server with the database which is being accessed.Any help/advice would be much appreciated! Hope i've given enough info for you guys.Cheers,TOm |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2009-08-21 : 21:08:24
|
| You need to do a couple of things.Firstly enable your SQL server locally or on a dedicated test box. It would be foolish to use prod db for development. Second, get your network guys to add some DNS entries for prod, dev,system test etc. This is optional but prevents mistakes and confusion.Then change the IP address in the connection string above to use the name & credentials you have set up.Also, unless it's an internal app, I would be very wary of having direct DB access from a web application. It's just too risky, especially if it's on the same box! Sounds like you are missing a layer. Try to tuck all your implementaion behind a service on the internal network and make your website in the DMZ as dumb as you can, just making calls to the service. |
 |
|
|
|
|
|
|
|