?
Solved

DSN connection to a SQL Server 'mdf' file

Posted on 2003-10-23
5
Medium Priority
?
1,422 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 525 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.
Suggested Courses

777 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