Print Page | Close Window

Connect to sqlexpress

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=13077
Printed Date: 01 Apr 2025 at 8:18pm


Topic: Connect to sqlexpress
Posted By: Hussein39
Subject: Connect to sqlexpress
Date Posted: 02 May 2011 at 6:40am
Hi there
i use Vitual stadio 2008 and i made a database using add items and them selected Service based database that its extension is .mdf . my database name is db.mdf. so now i want to make a report using Crystal report. i selected crystal report from add items then i choose the using the report wizard and then standard and click ok. and in standard report creation wizard i was expanding OLE DB (ADO)and in OLE DB (ADO) Box i choose Microsoft OLE DB Provider for sql server not in connection information box. i wrote .\sqlexpress and chose integrated security and in front of Database i wrote DB.mdf and when i click finish its message that
Logon Failed.
Details: Ado error code: 0x
source: Microsoft OLE DB Provider for sql server
Description: Can not open database "DB.mdf" requested by the login. The login failed.
sql state: 42000
Native error.
thank you



Replies:
Posted By: BrianBischof
Date Posted: 04 May 2011 at 7:08am
The '.mdf' part of the database name is for SQL internal processing only. You can't refer to with that extension yourself. For the server name, use '.\sqlexpress' like you already did, and for the database name, just use 'DB' without the .mdf extension.

Brian


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window