please check this code
and tell me what is the problem with this .....
i get error"operation is not allowed when the object is open"
dim conn as new adodb.connection
private sub commandbutton1_click()
conn.connectionstring="dsn=localhost;uid=root;pwd=root;"
conn.open
dim cmd as new adodb.command
cmd.commandtext="select sname from stu"
cmd.commandtype=adcmdtext
cmd.activeconnection= conn
end sub