How can SilkTest connect to more than one SQL Database through one DSN connection?
Firstly when you set up your ODBC connection to the SQL database.
Do not set a default database but leave this blank. In your SilkTest script you can set up a different handle to each database you want to connect to by specifying the "DATABASE=" parameter in your connection string.
So if you have two databases e.g. "Data1" and "Data2" and an ODBC connection called "SQLTEST" you could do the following;
string ReadData // Set up blank Database Handles HDATABASE hdbc1,hdbc2 // Set Up Blank Sql handle HSQL hstmnt // Set up database handles to your databases hdbc1 = ("DSN=SQLTEST;DATABASE=Data1") hdbc2 = ("DSN=SQLTEST;DATABASE=Data2") // Execute Sql statements on each database hstmnt = DB_ExecuteSql (hdbc1, "Select * FROM Table1") while (DB_FetchNext (hstmnt, ReadData) == TRUE) print (ReadData) hstmnt = DB_ExecuteSql (hdbc2, "Select * FROM Table2") while (DB_FetchNext (hstmnt, ReadData) == TRUE) print (ReadData)