People these days in doing student information management system, appear
The most should be the problem, "Real time error ' 91 ': Object variable or with block variable not set." As shown on the right:
In this case, we should first refer to MSDN, but at this point MSDN does not seem to help us a lot, summed up, in fact, there are many kinds of errors in the situation:
1. No ODBC data source or ODBC data source configuration error was configured prior to running the program, assuming that SQL Server executed the associated SQL code (the Student.mdb file used in the student system).
2, code problems, most of the cases are query statements have problems, such as:
(1), less space between SQL statements: txtsql = "SELECT * Fromstudent_info"
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/
(2) In the form where the student status information is executed, the execution statement txtsql = "SELECT * from Result_info where", because the condition is added later, so there is an error in missing space between ' where ' and ' '.
(3) In a complete query, such as txtSQL = "SELECT * from Class_info where class_no= '" & Trim (Txtclassno.text) & "", where in the Final Judgment input box conditions, double quotes and single quotes must be noted (the whole quote is divided into three layers from outside to inside: double quotes, single quotes, double quotes), not to break their order level, nor absent-minded.
3, logic error: The lack of statements, the execution of the sentence txtSQL correct assignment, directly manipulate the data in the database, saying that the popular point is not yet connected to the database on the operation, which is also my mistake. After assigning the value directly executes to the database additions and deletions to check, completely puts the call judgment and the connection database function ExecuteSQL behind the brain.
4, there is the MSDN prompts, such as the attempt to use the object variable has been set to nothing and so on, there is no more to say, please refer to the MSDN for VB6.0