
March 26th, 2003, 03:13 AM
|
|
Registered User
|
|
Join Date: Mar 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
oledb error with access database
i have an access database and i'm trying to access it using the oledb properties. here is my procedure:<br><br><br>Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnLogin.Click<br> Dim objConnection As OleDbConnection<br> Dim objCommand As OleDbCommand<br> Dim objDataReader As OleDbDataReader<br> Dim strSQLQuery As String<br><br> objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:WWWRoot echempirenetdatabase echempire.mdb;")<br><br> strSQLQuery = "SELECT * FROM users_tb WHERE userName = " & txtUsername.Text<br><br> objCommand = New OleDbCommand(strSQLQuery, objConnection)<br><br> objConnection.Open()<br><br> objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConn ection)<br><br> lblSQLCommandLabel.Text = strSQLQuery<br><br> EmployeeDataGrid.DataSource = objDataReader<br> EmployeeDataGrid.DataBind()<br> End Sub<br><br><br><br>when i execute the page i get the following error:<br><br><br>Server Error in '/' Application.<br>--------------------------------------------------------------------------------<br><br>No value given for one or more required parameters. <br>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. <br><br>Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.<br><br>Source Error: <br><br>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. <br><br>Stack Trace: <br><br><br>[OleDbException (0x80040e10): No value given for one or more required parameters.]<br> System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32 hr) +41<br> System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS dbParams, Object& executeResult) +154<br> System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object& executeResult) +92<br> System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior behavior, Object& executeResult) +65<br> System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) +112<br> System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior) +57<br> techempire.login.btnLogin_Click(Object sender, ImageClickEventArgs e) in C  evelopmentVisual Studio ProjectsVSWebCachewww.techempire.netlogin.aspx.vb: 66<br> System.Web.UI.WebControls.ImageButton.OnClick(Imag eClickEventArgs e) +109<br> System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +69<br> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18<br> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33<br> System.Web.UI.Page.ProcessRequestMain() +1263<br><br> <br><br><br>--------------------------------------------------------------------------------<br>Version Information: Microsoft .NET Framework Version:1.0.3705.288; ASP.NET Version:1.0.3705.288<br><br><br>PLEASE HELP!!! <img border="0" src="/forum/emoticons/freaked.gif" height="30" width="18" alt="freaked" />
|