Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
nisha1231 Absent Member.
Absent Member.
2316 views

dsn less connection to excel in Silktest classic

Jump to solution

Is it possible to connect to excel without DSN in Silk test classic? Iam getting an error "connection not open" on executing the below.

STRING sConnectionString = "driver="{Microsoft Excel Driver (*.xls)};Server=Hostname;UID=new;Pwd=new;Database=C:\test.xls"

HANDLE hDB = DB_Connect (sConnectionString)

STRING sSQL = "SELECT * FROM `Sheet1$` `Sheet1$` where TestcaseID = {strTestcaseID} "

HANDLE hSQL1 = DB_ExecuteSQL (hDB, sSQL)

Tags (2)
0 Likes
1 Solution

Accepted Solutions
cwBrendan Absent Member.
Absent Member.

RE: dsn less connection to excel in Silktest classic

Jump to solution

You can definitely use a DSN-less connection with SilkTest Classic as my team has been doing this for years. In your connection string I'm not sure that you need to specify the server, UID, or Pwd since you are just opening an Excel document and not an actual database.

You can find a variety of different connection strings for Excel here:

www.connectionstrings.com/excel

0 Likes
5 Replies
Micro Focus Contributor
Micro Focus Contributor

RE: dsn less connection to excel in Silktest classic

Jump to solution

Hello Nisha

You will always need a DSN connection in SilkTest Classic. Please remember that 4Test is a scripting language and not a programming language and so it does not have the flexibility of a programming language.

SilkTest Workbench, Silk4Net and Silk4J all make use of programming languages. It is possible to access a database from any of these without creating a DSN.

-Dai

0 Likes
cwBrendan Absent Member.
Absent Member.

RE: dsn less connection to excel in Silktest classic

Jump to solution

You can definitely use a DSN-less connection with SilkTest Classic as my team has been doing this for years. In your connection string I'm not sure that you need to specify the server, UID, or Pwd since you are just opening an Excel document and not an actual database.

You can find a variety of different connection strings for Excel here:

www.connectionstrings.com/excel

0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: dsn less connection to excel in Silktest classic

Jump to solution

Thanks for that - something I'd assumed couldn't work.

0 Likes
Highlighted
cwBrendan Absent Member.
Absent Member.

RE: dsn less connection to excel in Silktest classic

Jump to solution

You're welcome.

I just tried a simple example and this connection string worked for me:

STRING sConnectionString = "driver="{Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\test.xls"

0 Likes
nisha1231 Absent Member.
Absent Member.

RE: dsn less connection to excel in Silktest classic

Jump to solution

Script worked on changing the connection string to below

STRING sConnectString = "driver="{Microsoft Excel Driver (*.xls)};DBQ=C:\test.xls"

Thank you

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.