Normal Topic @SpecCommand when 'type' is Export (Read 779 times)
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
@SpecCommand when 'type' is Export
Nov 28th, 2009 at 6:56am
Print Post Print Post  
CommandButton to find all records in Pricing.db for a specific ClientID.  The following programming will execute the Sort code, and will execute the Table code.  But it doesn't execute the Export code.  Where am I fumbling?

     vSortLoad = @SpecCommand(Spec_Operation_Load, Spec_Type_Sort, "AllItemsForAClient-SortByItemDesc-Ascend")
     vSortRun = @SpecCommand(spec_Operation_Run, Spec_Type_Sort, "")

     vTableLoad = @SpecCommand(Spec_Operation_Load, Spec_Type_Table, "WebExport-ItemDesc-Ascend")
     vTableRun = @SpecCommand(Spec_Operation_Run, Spec_Type_Table, "")

     vExportLoad = @SpecCommand(Spec_Operation_Load, Spec_Type_Export, "WebExport-ItemDesc-Ascend")
     vExportRun = @SpecCommand(Spec_Operation_Run, Spec_Type_Export, "")
  

Larry
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: @SpecCommand when 'type' is Export
Reply #1 - Nov 28th, 2009 at 5:32pm
Print Post Print Post  
Are you sure you have an export spec named "WebExport-ItemDesc-Ascend'? Check that your spelling is correct.


Actually, I prefer to use the @LoadExportSpec and RunExportSpec type of commands rather than @SpecCommand, because they return a "1" if they succeed, and a "0" if they fail. This allows me to do some checking within the code, to see if they loaded properly. I use something like the following:

Code
Select All
	Success = @LoadExportSpec("Export All")
	If Success = 1
	{
		RunExportSpec("Data\Church Directory.txt", "", "", 0, 0, 0, 0, 0, 0, 0, 1)
		Success = @AsynchShell("\Sesame2\Data\Church Directory.doc")
		@Exit
	}
	Else
		@MsgBox("NOTICE!", "Export aborted. The ""Export All"" export spec failed to load.", "It may have been deleted or renamed.")
 


This will alert me if something goes wrong down the road, due to a name change or deletion, etc.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: @SpecCommand when 'type' is Export
Reply #2 - Nov 28th, 2009 at 7:35pm
Print Post Print Post  
Hi Carl,

thanks for your help.  I'll experiment via your suggestions (and double check my spec name ... was getting pretty bleary eyed last night when I gave up!)
  

Larry
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: @SpecCommand when 'type' is Export
Reply #3 - Nov 28th, 2009 at 9:28pm
Print Post Print Post  
made another export spec named WebExport1, for simplicity, and the @SpecCommand code won't fire that one either.  It's a mystery.

I'll try RunExportSpec later today
  

Larry
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: @SpecCommand when 'type' is Export
Reply #4 - Nov 28th, 2009 at 10:27pm
Print Post Print Post  
Carl, your suggestion to use RunExportSpec worked - thank you.
  

Larry
Back to top
IP Logged