Adds Transact-SQL text to the command buffer.
SqlCmd% ( sqlconn%, cmd$ )
where
SUCCEED (1) or FAIL (0).
SqlCmd% adds text to the existing command buffer. The added text does not delete or overwrite the current contents until the contents of the buffer are sent to SQL Server.
After a call to SqlExec% or SqlSend%, the first call to SqlCmd% automatically clears the command buffer before the new text is entered. If you do not want the command buffer automatically cleared, set the sqlnoautofree option with SqlSetOpt%. When sqlnoautofree is set, the command buffer is cleared only by a call to SqlFreeBuf.
The size of the command buffer depends on the amount of available memory.
Note You can call SqlCmd% repeatedly. Sequential calls are concatenated, so be sure to add any necessary blanks at the end of one line or the beginning of the next.
The following code fragment shows how to use SqlCmd% to build up a multiline SQL command:
Result% = SqlCmd%(Sqlconn%, "SELECT name FROM sysobjects") Result% = SqlCmd%(Sqlconn%, " WHERE id = 5") Result% = SqlCmd%(Sqlconn%, " AND type = 'S'")
SqlFreeBuf; DB-Library for Visual Basic Options