Solved

DSN connection to a SQL Server 'mdf' file

Posted on 2003-10-23
5
1,352 Views
Last Modified: 2006-11-17
I have a website which uses a SQL Server database (version 7 I think).

I have two database files a 'mdf' and a 'ldf'.

This is the asp code that connects to it
---
   Application("Conn_ConnectionString") = "DSN=km" 'local
   sql = "SELECT * FROM AdminUser"
   set rsPass = server.CreateObject("adodb.recordset")
   rsPass.Open sql, Application("Conn_ConnectionString")
---
I have only ever used MS Access databases in the past so im not sure where to start.

What software do I need to install?
How do I setup the DSN connection - Is it the same as MS Access?
0
Comment
Question by:LaurentKyan
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9606960
>>How do I setup the DSN connection - Is it the same as MS Access? <<
The connection string is not the same as MS Access and you do not have to use DSN.  Here are the connections trings for the OLE DB Provider for SQL Server:
http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForSQLServer

If you really want to use DSN than see this:
ODBC Driver for SQL Server
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSQLServer

Anthony
0
 

Author Comment

by:LaurentKyan
ID: 9607003
Do I have to have SQL Server installed or can I connect to the database  files without it?
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9607095
You will need to have MS SQL Server Client software installed in your PC.

The rest is same. Define a DSN to MS SQL SERVER DATABASE using odbc administrator (odbcad32.exe)

HTH

Namasi Navaretnam
0
 

Author Comment

by:LaurentKyan
ID: 9607180
Is MS SQL Server Client software availible for free or is it a licenced product?
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 175 total points
ID: 9607238
You do not need to install MS SQL Server client software on all your workstations.  At most, all you need is MDAC, which you can download from:
www.microsoft.com/data

Anthony
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SqlDataBase 7 48
Loop to go backward 90 days 2 18
VB.net and sql server 4 35
How to create a unique rule restriction on a table for two fields 16 82
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

770 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