Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


link to a mdf database

Posted on 2004-03-30
Medium Priority
Last Modified: 2013-12-16
ok so i created a MS SQL db , but now i cannot link to it.

 I WOULD like to create a database in my C:/Cfusion/wwroot folder and not in ProgramFiles/MicsoSQL/Data folder.

Is that possible? How? I cannot create a new database in anywhere but ProgramFiles/MicsoSQL/Data folder.

Now i have an mdf in wwroot, but it does not show in enterprise manager?

This is bothering me because i need to seelct it so i can create a super user for it , and then an ODBC datasource so i can use it with coldfusion.

I think it needs to be in my wwwroot to work for coldfusion
Question by:finnstone
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

Author Comment

ID: 10720945
basically my site stopped working and i dont know why, all i did was change from access to sql (first experience with sql) and i have a host.

i posed the question aboce because now i am testing on my computer, the host took care of my sql stuff so the problem has to do with the code i used

all i i did was change

all instances of cfquery datasource="#Application.DataSource#"


cfquery datasource="#Application.DataSource#" username="xxxxxx" password="xxxxx"

I also changed my application.cfm file to

<cfset Application.DataSource = "blueprintdatabase">

Accepted Solution

ctcampbell earned 2000 total points
ID: 10721070
This seems to be a continuation of your other questions (with more detail), so I'll try to answer completely.  If this answers your other questions, please make sure to follow up on them, too.

SQL Server does not behave the same way as Access.  You do not connect to the MDF file.  You connect to the server and select a database.  The default location for the database files is (I think), \Program Files\Microsoft SQL Server\MSSQL\Data, though you can point a database to a different location when you create the database (either with Query Analyzer (QA) or Enterprise Manager (EM)).  Please look at "CREATE DATABASE" in the books online.  If you are creating the database in EM, look at the "Location" box in the "Data Files" or "Transaction Log" tabs of the "Database Properties" box.  I would highly recommend that you not put the mdf and ldf files anywhere in your web document tree.  They should not be accessible from any URL.  You might want to create a folder called "Data" under "Inetpub" for the SQL data files that is not world-readable.

If you wish to move a data file, then you need to detach the database, move the data file, and reattach the db (see "sp_detach_db" in Books Online).

As for ColdFusion, it comes with native SQL Server drivers that you should use instead of ODBC.  On the datasources page, enter a name for your datasource (this can be anything, it's just a description to use in your CFQUERY's) and select Microsoft SQL Server as the type.  Then, the database name is the name of your database in SQL Server, the server is the hostname or IP address running SQL Server (i.e. localhost) and the username and password are a SQL Server user name.  Your SQL Server should be set for mixed-mode, and you should have created the user in EM with access to the database.
LVL 13

Expert Comment

ID: 10721769
I think it needs to be in my wwwroot to work for coldfusion -- No.  This does not matter, the ODBC connection takes care of the information.

This may sound like a stupid question, but:
Is your host providing a SQL-Server for your database to attach to at the other end ?
LVL 75

Expert Comment

by:Anthony Perkins
ID: 10743343
Please maintain your many old open questions:

1 03/15/2003 25 link to 1000 outstanding points  Open Macromedia Flash
2 05/13/2003 270 Who is good at reading source code?? (10...  Open Macromedia Flash
3 07/24/2003 500 PAYPAL in FLASH  Open Macromedia Flash
4 07/28/2003 500 Need to add UPS Online Tools to my ecomm...  Open ColdFusion
5 12/13/2003 500 best credit card processing service for ...  Open ColdFusion
6 12/13/2003 500 payment processing  Open Web Servers
7 11/17/2003 500 360 viewer  Open Macromedia Flash
8 03/29/2004 500 Decrease File Size  Open Macromedia Flash
9 03/29/2004 500 MDF OR LDF  Open Microsoft SQL Server
10 03/30/2004 0 Converted MS Access Datasource to SQL  Open ColdFusion
11 03/30/2004 500 link to a mdf database  Open Microsoft SQL Server
12 03/30/2004 500 sql server not working  Open ColdFusion
13 03/31/2004 500 update query between access and mysql?  Open Mysql
14 03/31/2004 500 Cannot connect to mysql on localhost err...  Open Mysql
15 04/01/2004 500 error executing db query after moving to...  Open Mysql
16 04/01/2004 500 weird error message from calling a cfc  Open ColdFusion
17 05/12/2003 35 simple SELECT statement confusion....wha...  Open ColdFusion
18 06/12/2003 125 Copy contents of one table to another us...  Open ColdFusion
19 08/29/2003 500 Custom tags in a CFC??  Open ColdFusion
20 10/28/2003 500 Coldfusion Server Not Working because i ...  Open ColdFusion
21 11/25/2003 500 root variables?  Open Macromedia Flash
22 01/06/2004 500 finding the letter of my cd drive?  Open MS-DOS

LVL 35

Expert Comment

ID: 10880175
No refund as finnstone never responded to the experts

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

636 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