Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-25-2009, 09:10 AM
TylerMitton TylerMitton is offline
Senior Member
 
Join Date: Nov 2009
Posts: 102
Default Database Connection Separated From Task

I will soon be creating several tasks that will scrape data from the web and insert it into a database.

I wan't to separate out my db connection from the individual tasks... so I tested out putting the connection into a sub-task and then calling that sub task from the scraping task. This didn't work because the session doesn't get passed between the child and parent tasks... which is understandable.

So I'm looking for a solution to having my database connection stored in a single location... so that if my database location/name/credentials change, I can update it all in one spot.

Any suggestions?
Reply With Quote
  #2 (permalink)  
Old 11-25-2009, 11:16 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

The Database:Connect command provides variable support for session name and connection string fields so what you can do is, use global variable that would read the value for these fields from a text file. That way whenever you need to change the credentials, just make the changes in the text file and you are done.

We have attached a sample task for your reference. To run this sample,

. Please copy .atmn under location, 'C:\...\My Documents\Automation Anywhere\Automation Anywhere\My Tasks' folder.
. Copy .txt under C:\.

Note: In all the sub tasks that you will create copy-paste these global variables.

Hope that helps.
Attached Files
File Type: zip GlobalDBConnection.zip (640 Bytes, 4 views)
Reply With Quote
  #3 (permalink)  
Old 11-25-2009, 12:26 PM
TylerMitton TylerMitton is offline
Senior Member
 
Join Date: Nov 2009
Posts: 102
Default

Thanks for the idea! Does this mean that the password must be in clear text in the txt file?
Reply With Quote
  #4 (permalink)  
Old 11-26-2009, 10:51 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

Unfortunately yes. However, there is one more option for global database connection. What you can do is,

. Create separate database say MyDB.mdb, create one table in it say 'ConnectStringTable' and create one field in it say 'ConnectStringField'.

. Password protect this database i.e. provide fixed username and password to connect MyDB database.

. Now store the connection string in 'ConnectStringField' field of 'ConnectStringTable' table.

. In your task, first connect MyDB database and get the connection string from 'ConnectStringTable' table into variable, $GlobalConnectionString$.

Note: $GlobalConnectionString$ should be of Value type. In all the sub tasks, you need to copy-paste $GlobalConnectionString$ variable.

. Disconnect MyDB database.

. Connect to your actual database using $GlobalConnectionString$ variable.

We have attached a sample task for your reference. Please copy it under location, 'C:\...\My Documents\Automation Anywhere\Automation Anywhere\My Tasks' folder.

That way whenever you need to change the credentials, just open MyDB database using the username and password and change the connection string in 'ConnectStringField' field of 'ConnectStringTable' table.

Hope that helps.
Attached Files
File Type: atmn RevisedGlobalDBConnection.atmn (1.1 KB, 2 views)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 05:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved