Returns the number of columns in the current set of results.
SqlNumCols% ( sqlconn% ) ( )
where
The number of columns in the current results set. If there are no columns, 0 is returned.
'Put two statements into the command buffer. cmd$ = "SELECT name, type, id FROM sysobjects" cmd$ = cmd$ " SELECT type FROM sysobjects" Result% = SqlCmd%(Sqlconn%, cmd$) 'Send the statements to SQL Server and start execution. Result% = SqlExec%(Sqlconn%) 'Process the results of each statement. DO UNTIL SqlResults%(Sqlconn%) = NOMORERESULTS PRINT SqlNumCols%(Sqlconn%); PRINT "column(s) in this result." DO UNTIL SqlNextRow%(Sqlconn%) = NOMOREROWS 'Code to print or process row of data. LOOP LOOP
Output:
3 column(s) in this result. 1 column(s) in this result.