Error 26 when deploying from visual Studio 2005 to Website

Discussion in 'Visual Studio' started by findcausene, May 20, 2010.

Thread Status:
Not open for further replies.
  1. findcausene

    findcausene chas28

    I have an application that I wrote using Visual studio 2005 that woks well within VS 2005. However, when I copy the website on to the DiscountASP server I get "error 26" when the user tries to login. The site works as long as I don't use membership .

    Can anyone offer any help.

    Charlie
     
  2. findcausene

    findcausene chas28

    Thanks Jose for the reference to the kb article. I missed it in my search.
    I made the changes in my web.config file that were called for in the KB article, however I am not sure I got the correct values for dBServer Name, Initial Catalog=DBName, and User ID=DBLogin.

    I have made a number of attempts to get these values without success.
    The following is typical of the error message I get when I copy the project to my website.
    How do I get these values? Any help will be appreciated because I’m stumped.

    Thanks.
    Charlie
    **********************************************************
    Login failed for user 'charlie'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'charlie'.

    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): Login failed for user 'charlie'.]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
    System.Data.SqlClient.SqlConnection.Open() +122
    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221
    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
    System.Web.UI.WebControls.Login.AttemptLogin() +115
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    ________________________________________
     
  3. Go in your Control Panel, and from the left hand side click on the SQL 2008 or SQL 2005 link depending on what database you have. The next page will give you the information to use to connect.
     
  4. findcausene

    findcausene chas28

    I have used KB article 337 and made the following changes to my web.config file.
    I replaced
    <connectionStrings/>
    with
    <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providerName="System.Data.SqlClient" />
    </connectionStrings>
    I have used the values supplied by DiscountASP .net for the ‘DataSource’, ‘user ID’ and Password. I now get the following error:
    ____________________________________________________________________
    Cannot open database "~\memberPages\capsDb1.mdb" requested by the login. The login failed.
    Login failed for user 'SQL2005_438481_charlesrosen_user'.
    _____________________________________________________________________

    I Visual Studio 2005 the app database is located in the MemberPages folder and is named capsDb1.mdb. I amabsolutely stumped on how to procede. How do I get the name of the database as it exists on the dicountasp.net website? Any help will be appreciated.

    Charlie
     
  5. Hi,
    You seem to be confusing SQL Server databases for Access databases.
    Have you added a SQL Server to your account or do you want to use the Access database on your site?
    All the best,
    Mark
     
  6. findcausene

    findcausene chas28

    Hi Mark,
    You're right I'm totally confused. I have added an SQL server to my account. But I want to use my acces database if that is possible.

    Charlie
     
  7. findcausene

    findcausene chas28

    I'm still confused. I think I'm hung up on getting the value of the 'INITIAL CATALOG = DBNAME ' in the web.config file. My access database name is 'MEMBERPAGES\CAPSDB1.MDB. This is not one of the file extentions you mentioned, i.e.: bmp doc gif jpe jpeg jpg pdf png psd txt zip

    If that's my problem, what do I do about it?

    Charlie
     
  8. Hi,
    We can help whichever way you want to go with this.
    I haven't tested Access databases on the IIS7 servers but I have seen some issues mentioned in the forums. Bruce, DASP Staff here, can fill in more on that.

    Is your DASP account on IIS6 or IIS7?
    (DASP = DiscountASP.NET)

    I'd also like to offer a few tips. . .
    If you are using Access with ASP.NET while it is possible to use the web.config as your data connection it isn't the best way to do it, for several reasons.
    First of all, Access is not good at serving your entire site, it is limited.
    Serving a page with Access is a lot easier and better for your site.
    For that you do not create the connection in the web.config, you create it in the code page.

    Additionally, you can use Access or SQL Server to get your Access data into your DASP SQL Server, which is world's better, then you don't have to worry about all the Access issues.
    All the best,
    Mark
     
  9. findcausene

    findcausene chas28

    Thanks for your advice. I'm not sure how to find outWhether ny DASP account is on IIS6 or IIS. Also I will try to find out how to get my Access data into the DASP SQL Server. Thanks again.

    Charlie
     
  10. Takeshi Eto

    Takeshi Eto DiscountASP.NET Staff

  11. findcausene

    findcausene chas28

    My DASP account is on IIS6.

    <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providerName="System.Data.SqlClient" />
    </connectionStrings>


    I'v tried all sorts of combination of value for the above change recommended by the KB article.

    I have hit a complete roadblock on how to get the proper configuration string code written. Where is the best place to go for help on this?
     
  12. Hi,
    This is an example of a complete web.config connection section for DASP accounts using ASP.NET

    <connectionStrings>
    <clear />
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL_numid_account;User ID=SQL_numid_user;Password=pw_here"
    providerName="System.Data.SqlClient" />
    <add name="SQL2005_userConnectionString" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL_numid_account;User ID=SQL_numid_user;Password=pw_here"
    providerName="System.Data.SqlClient" />
    </connectionStrings>

    ...In your example above you appear to have that part correct.

    The next thing will be how the ASP.NET page is making calls to it.

    How are you doing that?
    All the best,
    Mark
     
  13. findcausene

    findcausene chas28

    Sorry for not getting back to you sooner but I found that my ‘Visual Studio 2005’ NS ‘XP’ operating system were corrupted and I could not repair my ‘.net frame’ work file. I have been completely overwhelmed with reinstalling both VS2005 and Microsoft XP. I now have them on line but when I deploy my program to the website some of the pages give me the following error:
    ______________________________________________________________________________
    Server Error in '/' Application.
    ________________________________________
    Could not find file 'E:\web\findcausene\htdocs\MemberPages\capsDb1.mdb'.
    Capsdb1.mdb is the name of my MS Access database. My website is www.findcause.net
    Everything in the file name appears to be correct except for “htdocs.” My question is- What is htdocs? I have done a web search but I don’t understand how it applies to my problem.
    Also on some pages the call to the database works ok.
    What can I do about this problem?
    Thanks for any help.

    I am noit sure how the page make calls.

    Charlie
     
  14. findcausene

    findcausene chas28

    Hi Wisemix:
    It took me a while to understand your reply. You are right my problem appears to be how the page makes calls.

    If I make the calls to the database through a 'GridView' control everything works fine, but if I use;
    DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source =" & Server.MapPath("~/memberPages/capsDb1.mdb"))
    DBConnection.Open()

    where capsDb1.mdb is the name of my access database I get an errror message. How do I correct this?

    Thanks for any help you can give me.

    Charlie
     
  15. Hi,
    There are several ways to do this but I find the easiest is to you the App_Data folder when your ASP.NET page is using an Access DB.
    Your project knows the location of that folder and protects it. Win/Win

    Using an Access DB control in VS the code would be like this:
    <asp:AccessDataSource ID="AccessDataSource1" runat="server"
    DataFile="App_Data\capsDb1.mdb"

    See how doing it that way offers both protection and makes this easier?
    All the best,
    Mark
     
Thread Status:
Not open for further replies.

Share This Page