[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setup a Local db for development

Posted on 2004-04-01
2
Medium Priority
?
250 Views
Last Modified: 2010-04-25
I have sql installed on my development (local) workstation. I have the test server for dwmx2k (patched) configured so it's hitting my local copy of IIS. I'd like to define stuff so that, while working against my test server the pages connect to my local (test) db. Do i have any choice except to be manually editing the db connections for which ever mode i want to be operating in?
0
Comment
Question by:juststeve
2 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 10733351
I believe you have to Manually Edit.
0
 
LVL 8

Accepted Solution

by:
alexhogan earned 1000 total points
ID: 10735518
I have several projects that I run that use development and production areas and backends.  This is something that I do in order to make that distinction without having to re-write any code or even modify it until the website/applicaton's release.

Depending on the technology that you're using the syntax may differ drastically so I'll only include pseudo code in this answer.

What you want to do is have the page(s) identify where they are being run. (i.e. local or remote)

$location = path for local testing

if($where_am_I == $location){
    connection code to local database
}
else{
    connection code to remote database
}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 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