Solved

DSN connection to a SQL Server 'mdf' file

Posted on 2003-10-23
5
1,397 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
[X]
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
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

729 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