I have an insert that does not take any parameters.
which is a better way of doing things?
Set writeConn = Server.CreateObject("ADODB.Connection")
Call OpenConnect(writeConn)
Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = writeConn
objCommand.CommandText = insstmt
objCommand.Execute()
writeConn.Close()
or
Set writeConn = Server.CreateObject("ADODB.Connection")
Call OpenConnect(writeConn)
writeConn.Execute(InsStmt)
writeConn.Close()
they seen to be doing the same thing…thank you!
They are equivalent. I would recommend you do it like this:
The adExecuteNoRecords parameter indicates that no data will be returned and avoids the creation of an (empty) recordset.
See here for more info.