fkheng Posted June 14, 2003 Posted June 14, 2003 initialiseDB() sqlStr = "SELECT * FROM LoginTable" command = New OleDbCommand() command.CommandText = sqlStr command.Connection = conn reader = command.ExecuteReader() my code halts at reader = command.executereader, and the error i get is that i am carrying out an invalid operation the conn value i assign to command.connection is initialised in a function which i call called initialiseDB i do not know why it stops here, can someone help me out? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted June 14, 2003 Author Posted June 14, 2003 oh yah, one more thing, the function is located in a module, where i declare the conn value as public, so i assume that my form can make use of the conn variable with no problems? am i wrong here? or must i pass back the conn value to the function caller and assign it to a local variable? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
wyrd Posted June 14, 2003 Posted June 14, 2003 You need to make sure the connection is open before executing ExecuteReader(), and I also don't see any place where reader is declared. Oh.. and make sure LoginTable exists in the db that your connection connects to. :) Quote Gamer extraordinaire. Programmer wannabe.
fkheng Posted June 15, 2003 Author Posted June 15, 2003 oh, i got it, i did not open the connection, thanx a lot! Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.