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 06-18-2010, 06:35 AM
BradFromOz BradFromOz is offline
Junior Member
 
Join Date: Jun 2010
Posts: 3
Send a message via Skype™ to BradFromOz
Default SQL Update To Access

I am having trouble working out the correct way to update variables back into an access database.

I can insert a text string ok but I can not grab any of the variables.

The code I am using to insert the text string is:

UPDATE tblEmailAddresses
SET txtEmailAddress='test'
WHERE UniqueId=1

From everything I have read I should be able to use

UPDATE tblEmailAddresses
SET txtEmailAddress=$Dataset Column(3)
WHERE UniqueId=1

or

UPDATE tblEmailAddresses
SET txtEmailAddress=$txtEmailAddress$
WHERE UniqueId=1

Any help would be appreciated, the script is attached and the db field names match the variable names in the task.

Cheers

Brad
Reply With Quote
  #2 (permalink)  
Old 06-18-2010, 01:21 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

The datatype of 'txtEmailAddress' field is text so we need to put quotes around variable value. Like this,

UPDATE tblEmailAddresses
SET txtEmailAddress='$Dataset Column(3)'
WHERE UniqueId=1

or

UPDATE tblEmailAddresses
SET txtEmailAddress='$txtEmailAddress$'
WHERE UniqueId=1

There is no attachment with your original post so if you could upload your task then we can amend it for your convenience.
Reply With Quote
  #3 (permalink)  
Old 06-18-2010, 01:36 PM
BradFromOz BradFromOz is offline
Junior Member
 
Join Date: Jun 2010
Posts: 3
Send a message via Skype™ to BradFromOz
Default

Thanks for the feedback.

I have given both of those options and still can't seem to get it to work.

I realised after I hit Submit last time that I forgot to attach but had to wait for the post to get approved.

Task and DB attached this time.

Thanks

Brad
Attached Files
File Type: zip support.zip (16.1 KB, 4 views)
Reply With Quote
  #4 (permalink)  
Old 06-18-2010, 02:38 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello Brad,

The given task, extracts txtEmailAddress from Access table and updates the same column (i.e. txtEmailAddress) with same value.

We have attached amended task that extracts txtEmailAddress where UniqueId=1 and updates txtEmailAddress of UniqueId = 2.

Please copy attached task under location, 'C:\...\My Documents\Automation Anywhere\Automation Anywhere\My Tasks' folder.
Attached Files
File Type: atmn SQLTestWrite.atmn (3.3 KB, 1 views)
Reply With Quote
  #5 (permalink)  
Old 06-19-2010, 02:36 AM
BradFromOz BradFromOz is offline
Junior Member
 
Join Date: Jun 2010
Posts: 3
Send a message via Skype™ to BradFromOz
Default

Thanks for your help, that did the job.

I was setting a default variable in the txtEmailAddress field in the example above. When I remove this default value the script works but if I leave the default value in there it doesn't.

This raises 2 questions for me.

1. Why doesn't the default value get passed
2. Why doesn't the default value get overwritten

I am happy to work without default values in 99% of cases but Murphy's Law will dictate that I will want to at some stage now.

Interested on your thoughts there.

Thanks for the quick response.

Brad
Reply With Quote
  #6 (permalink)  
Old 06-22-2010, 04:43 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

Regarding your query,

1) This is very strange as we have never heard or seen such type of behaviour before. However, let us investigate. In the task, we are assigning value of DataColumn(5) to txtEmailAddress at line number 9 so ideally it overrides the default value. You can check the value of txtEmailAddress variable using msgbox command before and after line number 9.

2) We suggest clearing txtEmailAddress variable in the beginning as the loop starts so that it can ensure it is not carry forwarding the old value. Use Variable Operation to assign blank to any user variable.

Hope that helps.
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 02:38 PM.


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