Solved

DSN connection to a SQL Server 'mdf' file

Posted on 2003-10-23
5
1,333 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
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS SQL Bulk load data error 5 33
SQL Server RDS clr assembly 4 34
Backup Job question 4 18
Complex SQL 10 32
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

744 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

16 Experts available now in Live!

Get 1:1 Help Now