Visual Studio2008とSQLServerを使用しています。現在、ADOを使用して接続していますが、テーブルにある列の数を取得したいと思います...
これが私が持っているものです
/*CODE FOR connecting to database**/
/*query to know number of columns in table*/
_bstr_t sSQLd="Select Count(*) From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME='[dbo].[mytable]';";
/*define variable to hold number of columns and
print number of coulms as an integer
*/
int COLS_PER_ROW = wcstod(sSQLd, NULL);
printf("COLS_PER_ROW: %d", COLS_PER_ROW);
テーブルに20列ありますが、出力され0
ますクエリまたはロジックを修正するにはどうすればよいですか?