i have on excel file. In this Excel file i have sheet for each N noof columns now i want get all the columns in a particular Excel sheet
Please let me know if you have any code in this regard
Thanks & Regards,
look at help for DB_Columns.
As far as I understand, this function is going to return a list of all columns in a table. So, once you done with your list, do a simple ListCount and you're there!
Hope this helps.
Can you please let me know the code using Excel file
As Dimaj told you look at the DB_Columns function in help, Connect to the excel you want to read, call DB_Columns function and DB_Columns would return quite a lot of info.
i tried but's not working for excel sheet, can you please let me know if you hav any code
use this code to get the column name, it returns you a lot of details. use this and check example in the help to tweak the result in the way you want.
<font class="small">Code:</font><hr /><pre>
[ ] HANDLE hDb = DB_Connect ("DRIVER=Microsoft Excel Driver (*.xls);DRIVERID=790;DBQ=C:\Test.xls")
[ ] LIST OF STRING ls
[ ] HANDLE hStmt = DB_Columns (hDb, NULL, NULL, "%", "%")
[-] while DB_FetchNext (hStmt, ls)
[ ] Print (ls)
Hope this helps