SilkTest Question 31 : How to update an Excel spreadsheet using SilkTest?

First of all the QA engineer should verify that ODBC data source, which SilkTest is going to use, is not set to read-only otherwise the Excel worksheet cannot be updated

The Microsoft's Excel OBDC driver does not support INSERT keyword, so QA Engineer will not be able to use this keyword in the SQL statement. Instead of INSERT keyword 4test code developer have to use to use the UPDATE keyword.

The following 4test example will update data in Microsoft Excel.

[ ]
[ ] HANDLE hDBC = DB_Connect("DSN=Documentation")
[ ]
[ ]
[ ] hSQLq = DB_ExecuteSQL(hDB, "UPDATE 'Sheet2$' SET 'Sheet2$'.Language='4Test' WHERE 'Sheet2$'.Name='Winrunner'")
[ ]
[ ] DB_Disconnect(hDBC)

Also take a look at SilkTest Interview Question 18: How to read data from Microsoft Excel worksheet?

1 comment:

nana said...

Hi friends...can any anybody tell me how to connect DB to silk tool..plz explain with steps

SilkTest interview questions for QA Testers