Assume that your automation scripts are using a DSN. It is difficult to configure DSN, whenever the script runs. But you can set the DSN details dynamically to connect with any database. Below I have given the sample silktest (4test) code to run the script without having physical DSN.
4test code:
[+] void GetAccessDB ()
[ ] STRING CONN_STRING = "Driver=" + Chr(123) + "Microsoft Access Driver (*.mdb)" + Chr(125) + ";Dbq=\\AppServer\build05.mdb;Mode=16;"
[ ] HANDLE dbConn
[ ] HANDLE hSQL
[ ]
[ ] dbConn = DB_Connect(CONN_STRING)
[ ] hSQL=DB_ExecuteSql(dbConn, "Select * from Emp_Master")
[ ]
[ ] DB_FinishSql (hSQL)
[ ] DB_Disconnect (dbConn)
No comments:
Post a Comment