My project is stoped because of this"Connection t

Reptileprincess

New Member
here is VB code if i run query it returns rows of data<BR><BR> Dim strResult As String <BR> Dim objDataReader As System.Data.OleDb.OleDbDataReader <BR> Dim strSQL As String = "SELECT * FROM Decriptions WHERE LangugeID = " & _LanguageID & " AND MenuItem = '" & _MenuItem & "' " <BR> Dim strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:inetpubwwwrootGlenviewSysDatabaseGlenSys. mdb" <BR> Dim objConn As New System.Data.OleDb.OleDbConnection(strConnection) <BR> Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, objConn) <BR> objConn.Open() <BR> objDataReader = objCommand.ExecuteReader <BR><BR> _Description = objDataReader("Description") <BR><BR><BR> objDataReader.Close() <BR> objConn.Close() <BR>--------------------------------------------------------------- <BR>I do know in fact that there is a column and there is an data in it <BR><BR><BR><BR>No data exists for the row/column. <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.InvalidOperationException: No data exists for the row/column. <BR><BR>Source Error: <BR><BR><BR>Line 63: objDataReader = objCommand.ExecuteReader <BR>Line 64: <BR>Line 65: _Description = objDataReader(1) <BR>Line 66: <BR>Line 67: <BR>I had a similar problem, it was because I had spelling errors in my SQL statement, from the above code your spelling "Descriptions" differently in different places as well as LanguageIDTurn tracing on, write strSQL to the Trace Log, copy it, paste it into Access and run it there. See if the query does indeed work first.
 
Back
Top