18. [ ] // execute the SQL statement
19. [ ] hstmnt = DB_ExecuteSql(hDB, sSqlCmd)
20. [ ] // get each row
21. [-] while(DB_FetchNext(hstmnt, lsCurrentRow))
22. [ ] Print("ID: {lsCurrentRow[1]}, Age: {lsCurrentRow[2]}, Name: {lsCurrentRow[3]}")
23. [ ] // finish transation
24. [ ] DB_FinishSql(hstmnt)
25. [ ] // close connection
26. [ ] DB_Disconnect(hDB)
27. [-] except
28. [ ] ExceptLog ()
29. [ ] return false
30. [ ] return true
31.[ ]
32.[-] testcase PrintTable()
33. [ ] string sFileName = "K:/pdf/Students.xls"
34. [ ] string sTableName= "Class1"
35. [ ] printTableRows(sFileName, sTableName)
文章来源于领测软件测试网 https://www.ltesting.net/