Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai everyone
In my web site,in login page i have to capture the ms access db path in session variable,in log in button i get the db path and store in session variable.but if i use in main pages ,sometime session value not pass to main pages and it gives error like "No error message available, result code: DB_SEC_E_AUTH_FAILED(0x80040E4D)."


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.OleDb.OleDbException: No error message available, result code: DB_SEC_E_AUTH_FAILED(0x80040E4D).

Source Error:


Line 1956: cmd = New OleDbDataAdapter(New OleDbCommand(strcmd))
Line 1957: cmd.SelectCommand.Connection = cn
Line 1958: cn.Open()------->with red color font
Line 1959: cmd.Fill(dt)
Line 1960: cn.Close()


if i use break point in connection string db path (session("dbpath")) is empty.

VB
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Session("dbpath") & "; Jet OLEDB:Database Password= password;")


Pls reply asap
Note:Sometimes it work,if not work again need to debug the web site.

Regards
Aravind
Posted

1 solution

There is nothing like a confusion here. You have already checked and found that sometimes session("dbpath") doesnt have value and thats why you are getting error.

First of all,I dont know why you are assiging your datasource like this. Try applying the datasource directly. Or before the statement try to check if session is empty(null) or not.

Regards..:laugh:
 
Share this answer
 
Comments
Aravindba 1-Aug-13 0:44am    
Thank for ur reply,if we take this way,based on user i have to change the database,so in log in page i have get the database path from table and pass in session variable.
And why i give connection string in each and every page,bcz in logout button i clear the session ,so only it not go back after log out otherwise it go previous page after logout

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900