rvermeulen Posted August 1, 2003 Posted August 1, 2003 Hello, I have an asp.net application that works fine connecting to an access DB that resides in the wwwroot directory of the webserver. I'm attempting to upgrade the database to SQL server 2000. The SQL server resides on the same box as the webserver. The database is in sql authentication mode, and I've created a userid and password for it. However, when the asp.net application tries to connect to it, I get an error stating. Login failed for user IWAM_servername. Invalid attribute for connection string. I'm not sure why it's attempting to connect as the windows user instead of the credentials I'm passing the connection. Does anyone have similiar issues or resolutions ? Thanks ! Rick Quote
rvermeulen Posted August 6, 2003 Author Posted August 6, 2003 Here is the connection string I'm attempting to connect with value="Provider = SQLOLEDB;data source=ServerName;Initial Catalog=DatabaseName;User=GenericUser;Pwd=GenericPwd;persist security info=true" Any help is truly appreciated. It continues to attempt to connect with the IWAM_servername account. Rick Quote
TommyGun665 Posted August 6, 2003 Posted August 6, 2003 Database Connection String here is what I'm using I can show you what I'm using successfully with MS SQL Server...but you should note that my SQL server is on a different host...so i imagine a difference for you in the Data Source name...you should be able to use localhost? Anyway here is what I have: 'This is the string used to connect to the database for this application Public Const DbConnStr = "Data Source=caaserver;" & _ "Initial Catalog=DEVCAAapplication;User ID=application;Password=apassword" . . . 'The call to connect 'Get Database connection Dim conn As SqlConnection Dim appLog As New ApplicationLog() Try conn = New SqlConnection(New ApplicationCfg().DbConnStr) Catch exc As Exception ApplicationLog.logError(ApplicationCfg.AppLogSrcStr, "Failure creating SQL Connection on AppointmentCollection DeleteOlderThan:" _ & exc.Message) success = False End Try ============================== There are parts that won't mean much to you but heres the string explained so you can compare it to yours: Data Source - I have the DNS name for the Windows2000 server Initial Catalog - the Database with the tables that is on that SQL Server implementation UserId - the SQL login (configured in MS SQL Server) Password - the SQL login's password (configured in MS SQL Server) Please also note that you need to have permissions set for SQLlogin id to be able to access the database, its tables and any stored procs you may have used (but that would be a different error than you are getting now). Sorry but the best I can do is show you what is working for me. I have lots to learn yet. :) Good luck, Quote
hcorrea Posted August 6, 2003 Posted August 6, 2003 rvermeulen, The problem could be that your SQL Server is configured to allow only Windows authentication. Go to SQL Server Enteprise Manager, look for your server (e.g. LOCAL), right click on it, go to Security tab. Take a look at the Authentication mode selected. If the mode is SQL Server and Windows, then what you have should work. If the Authentication mode is Windows only, then that's probably your problem. For Windows only authentication you need to pass something like "trusted connection=yes/true" as one of the parameters instead of the username and password. I don't have an example handy but you can find about this on Google. You might want also to try with a connection string like this (for SQL Server and Windows authentication.) value="server=(local);database=mydb;uid=myusr;pwd=mypwd" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.