May 24, 2017 at 8:13 am
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 select 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
May 24, 2017 at 8:20 am
olafurpetursson - Wednesday, May 24, 2017 8:13 AMSo 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 select 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
ProgramFiles/MicsoSQL/Data points to the default directory SQL uses after a default installation.
You can change your default Database Data and Log (MDF & LDF) directories in the instance properties, under Database Settings.
You can, if this DB is not attached in SQL, move it from the default directory to your required directory.
In saying all of this, I have to ask
1) why do you want the DB on C drive? This goes against every best practice for a couple of reasons.
2) why do you explicitly need the DB in a different folder, once attached in SQL Server, you use it the same way. Permissions are applied via SQL and not file level on disk.
3) how did you create this Database; via SSMS, or just a new file on disk in the directory?
A couple of things don't add up from your description for me.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
May 24, 2017 at 8:20 am
Sounds like the Service Account SQL Server is running on does not have permission to access the folder. Check the Service accounts permissions, and grant it control of the folder the file is located in.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
May 25, 2017 at 9:05 am
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.
May 25, 2017 at 9:06 am
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). If the file is corrupted or doesn't open you, then you need mdf opener
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.
May 25, 2017 at 12:45 pm
Thank you guys for your feedback and help. Thank you!
May 26, 2017 at 8:39 am
If you want to change rights, use a group, the service account group for SQL, not the account.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply