Crystal Reports will not allow me to select database - asp.net

Hi I'm trying to create a report and link it to be my database within Visual Studio 2010 but when I try to make the OLE DB (ADO) connection the database does not appear within the Connection Information (Server, UserID, Password and Database) and then when I manually try to type in the database I get the error message:
"Failed to open the connection. Details: ADO Error Code: 0x80004005. Source: Microsoft OLE DB Provider for SQL Server Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. SQL State: 08001. Native Error:17 [Database Vendor Code:17]"
the database is an MDF file
Any suggestions??

While using OLE DB (ADO) connection please select the checked of Integrated Security CHECKBOX and do no enter any credentials. Hope this helps

Related

Classic ASP connecting to localdb for SQL Server

Can anyone explain why this works
Conn.Open "Provider=SQLOLEDB;Server=tcp:myazurename.database.windows.net;Database=People;Uid=MyUid;Pwd=MyPwd;Encrypt=yes;"
and this doesn't
Conn.Open "Provider=SQLOLEDB;Server=(localdb)\v11.0;Database=People;Uid=MyUid;Pwd=MyPwd;Encrypt=yes;"
I copied my live azure database locally for dev work in Classic ASP and the error message is
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).] SQL Server does not exist or access denied.
Azure SQL server version: 11.0.9231
Local SQL server version: 11.0.2318
I can connect using the same details on SQL Server Management Studio so its not a user permissions thing...
Under Security for the server, the user has public server role, the user mapping for the 'People' database is everything except db_denydatareader and db_denydatawriter.
I have also tried (localdb)\\v11.0 which doesn't make a difference.
Any ideas?
OK so I believe the answer is as follows: It doesn't like (LocalDb)\V11.0 it wants a proper instance name like you said in the first place. MACHINENAME\INSTANCENAME OR localhost\INSTANCENAME which I am using as this is going to be replicated for other devs. Also, you DONT NEED two back slashes! My problem is I somehow didn't have a local instance installed. Thanks or your help #Lankymart

Database is not accessible on server but working well on localhost

I have developed my first website in ASP.NET with C#. It's a small website which uses Microsoft SQL server 2008 for database and I've deployed it on a free hosting site www.somee.com. It's database is working well on my computer but when I try to access the database on server it gives following error:
[ A network-related or instance-specific error occurred while establishing a
connection to SQL Server.
The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)].
I have updated connection string of the database in web.config and I've used getConString() method for accessing connection string like this:
public string getConString()
{
return System.Configuration.ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
}
What can I do to solve this problem.
Wbsite url is: www.easyways.somee.com
Thanks all of you for your support. I got the solution for my problem. Actually I did something wrong either in creating a database or in using connection string.
Now I recreated a blank database and then I executed the SQL script that I created for my database by navigating to "User -> Managed products -> MS SQL -> Databases -> (Database name) -> New SQL query from file". And also updated the new connection string in web.config file.
This is the connection string I used now:
"workstation id=dataeasyways.mssql.somee.com;packet size=4096;user id=easyways_db;pwd=********;data source=dataeasyways.mssql.somee.com;persist security info=False;initial catalog=dataeasyways"
Your hosting provider provides the connection information for you (in the case of your hosting provider you can see their Help Page here, which shows you how to connect to their DB.
Basically it boils down to logging into their control panel.
In "User menu" navigate to "User -> Managed products -> MS SQL -> Databases -> (Database name)".
Also remember that since this is a remote database there is a small chance that its firwalled from the outside world and only local webservers can access the database.

Cannot open database 'dbname' requested by the login. The login failed

Firstly, I know that there are a lot of similar topics, but none seem to solve my problem.
I have inherited a project where the front-end is built in ASP.NET and the CMS is built in classic ASP. I'm in the process of setting up a local development environment where I've copied the database from the live server and am configuring the website to connect to my new local DB.
The ASP.NET part is connecting with the connection string Data Source=.\\SQLEXPRESS; Database=DBNAME; Trusted_Connection=True; but I had to mess about with Application Pools and Permissions.
I'm having a problem with getting the classic ASP part of the website to connect to the SQL database. The error I am recieving is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "DBNAME" requested by the login. The login failed.
/cms/connections/Conn.asp, line 18
The code in that file is:
12. Dim Conn_STRING, URL, mailHost
13. Conn_STRING = "Driver={SQL Server}; Server=.\SQLEXPRESS; Database=DBNAME; Trusted_Connection=True;"
15. Dim conn
16. set conn = Server.CreateObject("ADODB.Connection")
17. conn.ConnectionString = Conn_STRING
18. conn.Open
I know it's a permission problem or some sort, but I can't get to the bottom of it. I'll appreciate any help at all :)
hmmmm, well, the asp.net part is using SQLExpress, connected via an attached file. DBNAME in the first example is going to refer to a db file name in the actual asp.net project. It's been quite a long time since I last used classic ASP, but I'd be STUNNED if it supports this. You need to attach the db file to an actual sql server and use it that way.
server=mycomputername\sqlexpress; database=DBNAME; user id=username; password=password
You'll need to open your database in sql express mngmt studio
http://www.microsoft.com/download/en/details.aspx?id=7593
Go into your security settings for that user and set the default database to "dbname" (whatver your real dbname is of course)
Ensure your app pool is set to run under the user that has permissions to that database. It may just be easier to enable mixed mode authentication and create a sql user to connect to the database rather than messing around with windows authentication on an app pool.
You wil lof course need to change your connection string then to support the sql authentication if you go that route.
http://msdn.microsoft.com/en-us/library/ms143705%28v=sql.90%29.aspx

Connect to an Access database with ODBC via ASP.net

I'm trying to set an ODBC connection to a MS Access, with an Asp.net app.
I keep getting this error message:
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data.
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data
I understand that maybe this has something to do with permissions because it works fine in a local app(console application).
already tryed to give read\write permission to 'IUsr_my-machine' but it still doesn't solve the problem
tks
It's not permissions. It's that the database is actually opened in MS Access somewhere. Opening an access database with the MS Access itself is different than connecting to it from another program. MS Access will lock the db while you work on it. You need to find who has it opened in MS Access and beat them over the head until they close the Access program.
After you do that, report to my office so I can beat you myself for choosing Access as a web database. That's a really dumb thing to do, because Access is an in-process or desktop class engine. Web sites really need a server-class engine like sql server express that can do a better job handling concurrent users.
For those who crash here with the same error. Try to put the MDB file under your domain folder and then create DSN. This resolved my issue.
UPDATE: If you are using datasource, make sure that "exclsive" is unchecked

DSN tests ok, but login failure trying to use the DSN to SQL Server 2005

I'm writing a small ASP.NET application in a hosted environment (meaning I don't own the server).
Using the hosting provider's webtools, I created a DSN that specifies the Driver, the Server, the UID, the PWD, and the Database. When I test the connection, it tests out fine.
However, when I load my web page with the code:
OdbcConnection DB = new OdbcConnection("DSN=MyDSNName");
DB.Open();
I get the error: ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''.
I know I'm using the correct DSN name because when I change to "DSN=NonExistentDSN" I get a different error.
I don't understand why the logon works when I test it but not when I use it in code. Since I don't own the server, some of the usual troubleshooting tools aren't available to me, but I'd appreciate any feedback the community has.
Perhaps the DSN does not retain the password. Have you tried to supply login credentials?
OdbcConnection DB = new OdbcConnection("DSN=MyDSNName;UID=login;PWD=password;");
DB.Open();

Resources