Highlighted
Absent Member.. Absent Member..
Absent Member..
379 views

How to connect to a database from TruClient?

Jump to solution

Hi,

 

Is there a good way to connect to a database(specifically SQL Server) from the AJAX TruClient?   I tried putting in a Evaluate C function, the lr_db_connect function and added #include <wssoap.h>(since that is where lr_db_connect comes from) in the globals.h but when running, I get that lr_db_connect is unrecognized.

 

I also attempted to do a ADODB.Connection from the JS functionality in TruClient but getting a "Safety settings on this computer prohibit a data source on another domain" error which I know it is an IE setting that I have to tweak but I can't change that on the TruClient IE.    Any ideas?  Thanks.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to connect to a database from TruClient?

Jump to solution

Hi Ray,

 

I have sent you a private e-mail with instructions how to provide the script.

Thank you in advane.

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

0 Likes
15 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to connect to a database from TruClient?

Jump to solution

Hi Ray,

 

TruClient is designed to access databases from a  browser  application  interface, not directly. What you are trying to achieve is not something which will work out of box and I am not sure if you will be able to achieve your goal.

However for enabling data sources across domains you can try these steps:

1.  close Vugen

2.  make the following settings changes in Internet Explorer installation on your machine  Tools- Internet Options->Security->Custom Level-> Access data sources across domains to "Enable".

3. Open Vugen and try to  connect  from the JS functionality in TruClient IE and let us know if you are still  getting the "Safety settings on this computer prohibit a data source on another domain" error.  

 

Thanks and kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: How to connect to a database from TruClient?

Jump to solution

Hi vmanalova,

 

I already tried that last week on IE and get same error.

 

If its not possible in Javascript,  can I connect to a database using Evaluate C by including the wssoap.h library(or any other way)?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to connect to a database from TruClient?

Jump to solution

Hi Ray,

 

I do not think that you will be able to connect to the server using lr_db_connect. In the Vugen function reference is stated that this function is available only within Web Services scripts. If it is an option for you, you can use Web services protocol to connect to the database.

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to connect to a database from TruClient?

Jump to solution

Hi Ray,

 

Can you please send me the script in which you are trying to connect to the server using JS functionality in TruClient for review.

 

Thank you in advance.

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: How to connect to a database from TruClient?

Jump to solution

Here is the zip file with the script.  The database connections have been changed for privacy purposes.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to connect to a database from TruClient?

Jump to solution

Hi Ray,

 

I do not see the zip file. Could you please try to uplaod it again?

Thank you.

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: How to connect to a database from TruClient?

Jump to solution

Sorry, I think forgot to click Add Attachment the first time

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: How to connect to a database from TruClient?

Jump to solution

is there another way I can send it?   For some reason, it looks like its not attaching to the post.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to connect to a database from TruClient?

Jump to solution

Hi Ray,

 

I have sent you a private e-mail with instructions how to provide the script.

Thank you in advane.

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

0 Likes
Highlighted
Contributor.
Contributor.

Re: How to connect to a database from TruClient?

Jump to solution

Can anyone help me on how to connect to DB2 database using TrueClient scripting ?

I need to fetech the test data from Databse and send that as parameter to my next step

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: How to connect to a database from TruClient?

Jump to solution

@SateeshGundu, if you read the thread in detail, you can only connect to a database via a soap / web-based protocol. You have to script the access with java script. I'm not sure if DB2 offers such a service out of the box. But you might checkout this.

Tip: develop you java script to access the database outside TruClient with a good debugger etc.

Signature:
Reward community members who take time to respond and help.
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.