Solved

link to a mdf database

Posted on 2004-03-30
6
746 Views
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
0
Comment
Question by:finnstone
6 Comments
 

Author Comment

by:finnstone
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#"

to

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

I also changed my application.cfm file to

<cfset Application.DataSource = "blueprintdatabase">
0
 
LVL 3

Accepted Solution

by:
ctcampbell earned 500 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.
0
 
LVL 13

Expert Comment

by:danblake
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 ?
0
 
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

Thanks
0
 
LVL 35

Expert Comment

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

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now