Normal Topic Mass update/word problem (Read 872 times)
Boneyard_Scrounger
Junior Member
**
Offline


Canadian Government =
Elected Dictatorship

Posts: 88
Location: Peoples Republic of Kanada
Joined: Apr 20th, 2005
Mass update/word problem
May 9th, 2005 at 9:10pm
Print Post Print Post  
It was a read only field in QA4, when it imported, it stayed read only, in the LE.
The programming for the mass update tests fine, and seems to run fine. But when I check, either it didn't work, or the LE is hidden. (doesn't show as hidden in the properties).
Could the actual field of the database still be read only? and how do I get arround that.

OK, since I posted this in the wrong forum, I have got the mass update to work. Not sure how, but I did.
This particular LE does not show up in word for merge however, so I thought I'd leave the above up so you could see the developments.
  
Back to top
IP Logged
 
Boneyard_Scrounger
Junior Member
**
Offline


Canadian Government =
Elected Dictatorship

Posts: 88
Location: Peoples Republic of Kanada
Joined: Apr 20th, 2005
Re: Mass update/word problem
Reply #1 - May 9th, 2005 at 9:11pm
Print Post Print Post  
The merge programming is as follows so far.
[F21] is the problem LE
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var vFileHandle as Int          // For writing data file
var vHeader as String           // Data file header line
var vData as String             // Data file data line
var n as Int = 1            // General purpose counter
var vSelectedDoc as String      // Document selected from menu
var vOneOrAll as String         // Include record(s) option
var F as array[25] of String    // Mergeable fields array
var vStartingRec = @ResultSetCurrentPosition()
var vGoPrint as String

// Next 3 lines user modifiable
var vDataPath as String = "C:\critical files\myfiles\word docs\flower.txt"
var vDocsPath as String = "C:\critical files\myFiles\word docs\"
var vWordPath as String = "c:\word.bat"


SUBROUTINE PrintCurrentRecordOnly()

If @Askuser("Merge print the " + vSelectedDoc + " for "
+ vOneOrAll + "?","","") Then
{

vGoPrint = "Yes"

n = 1                  
While F[n] <> ""
{
     vHeader = vHeader + F[n]   + "^"
     vData   = vData   + @(F[n]) + "^"
     n = n + 1
}

vFileHandle = fileOpen(vDataPath)
fileSeek(vFileHandle, 0)
fileWriteLn(vFileHandle, vHeader + @NewLine() + vData)
fileClose(vFileHandle)

}

END SUBROUTINE

SUBROUTINE PrintAllRetrievedRecords()

var n as Int
var i as Int = 1

If @Update Then
{

If @Askuser("Merge Print " + vSelectedDoc + " for these " + @ResultSetTotal() + " retrieved records?",
"( If not, cancel this task, press F7 for a new search,"," and retrieve the records DO you want to print. )")
Then
{

     vGoPrint = "Yes"

     n = 1                  
     While F[n] <> ""
           {
           vHeader = vHeader + F[n]   + "^"
           n = n + 1
           }

     vFileHandle = fileOpen(vDataPath)
     fileSeek(vFileHandle, 0)
     fileWriteLn(vFileHandle, vHeader)

     For n = 1 to @ResultSetTotal()

     ResultSetCurrentPosition(n)

     While F[i] <> ""
           {
           vData = vData + @(F[i]) + "^"
           i = i + 1
           }

     FileWriteLn(vFileHandle, vData)

     @Msg("Processed Record " + n + " of " + @ResultSetTotal())
     vData = ""
     i = 1

     Next

     fileClose(vFileHandle)

     // Rewind to record where it all started
     ResultSetCurrentPosition(vStartingRec)

     }
}
Else
@Msgbox("Printing retrieved records can only be done in Update mode.","","")

END SUBROUTINE


// BEGIN MAIN PROGRAM

// Build documents menu

vSelectedDoc = @PopupMenu(
"Flowersheet.doc;"   +
"wreathsheet.doc;", "SELECT MERGE DOCUMENT" )

// Build which record(s) menu

vOneOrAll = @PopupMenu(
"THIS Record Only;" +
"ALL Retrieved Records;" , "SELECT RECORD(S) TO MERGE PRINT" )

If vSelectedDoc <> "" and vOneOrAll <> "" Then
{      

     // Delete existing data file. A new one will be generated.
     If FileExists(vDocsPath + vSelectedDoc) Then
     {
     fileDelete(vDataPath)      

     // Fields available for merging
     F[1] = "Search";                 F[2] = "First_name";     F[3] = "Last_Name"
     F[4] = "Street_Address" ;        F[5] = "Town";           F[6] = "Postal_Code"
     F[7] = "Province_State";         F[8] = "Country" ;       F[9] = "Range"
     F[10]= "Section";                F[11]= "Lot";            F[12]= "Bed_Size"
     F[13]= "Ger_,_Beg";              F[14]= "Ger_,_Aly";      F[15]= "Beg_,_aly"
     F[16]= "Pet_,_Aly";              F[17]= "IMP_ONLY";      F[18]= "Planting_Charge";
     F[19]= "Service_Charge";       F[20]= "Monument_Marker_Name";      F[21]= "Decoration_Day_is";

     If vOneOrAll = "THIS Record Only" Then
           PrintCurrentRecordOnly()
     Else
           PrintAllRetrievedRecords()

     If vGoPrint = "Yes" Then
     {
           // Start Word via Word.bat and pass doc filename.            
           n = @Shell(vWordPath + " " + @Chr(34) + vDocsPath + vselectedDoc + @Chr(34))
           If n = 1 Then
           @Msgbox(vDocsPath + vSelectedDoc,"word.bat not found or something else wrong.","")
     }
     }
     Else
           @Msgbox(vDocsPath + vSelectedDoc + " doesn't exist.","","Please be sure that Flowersheet.doc is in the directory C:\myfiles\word docs\, Please Try Again!")
}


  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Mass update/word problem
Reply #2 - May 10th, 2005 at 12:26am
Print Post Print Post  
Is F21 bound to a database field?

What is the type of field of that database field?

Do you need to convert F21 from a Date to a String?

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Boneyard_Scrounger
Junior Member
**
Offline


Canadian Government =
Elected Dictatorship

Posts: 88
Location: Peoples Republic of Kanada
Joined: Apr 20th, 2005
Re: Mass update/word problem
Reply #3 - May 10th, 2005 at 11:53am
Print Post Print Post  
It's bound to !Decoration_Day_is.

Do I need to convert from a date to a string? It is a date format. Long intl.
  
Back to top
IP Logged