I am consistently getting an error message represented by the image below called Image1-ErrorMsg
I have tried a variety of approaches to get data from table A in a master database into a smaller database that is a mirror of the larger (just smaller).
Every time I run an Append data or Import I get the message.
The image ExportTable is the structure from the larger table. The image ImportTable is the structure of the smaller table.
The numeric fields in the receiving table are not too large as numeric fields.
The unusual part of the operation is that when I click the OK button on the error message and then review the table all the data is in the table as it should be. I can find no number in any numeric field larger than 3 digits (plus 2 decimals. In any table in the entire set there is no field with a number larger than 4 digits.
Any suggestions as to where I should look or what the problem might be?
The code for the import is as follows and is generated from the import genie versus me doing the hard code.
temporary_import_table = file.temp_path_get()+ "driver_temp_table.dbf"
import_destination_table = "driver"
import_filename = filename_decode("[exe_folder]files\districts\central\27\districtexportdriver.txt")
if file.exists(import_filename) = .f. then
ui_msg_box("Error","File to import not found: '"+import_filename+"'.",ui_stop_symbol)
end
end if
ON ERROR GOTO ERROR2202200718596562
import.type = 0
import.names = "use"
import.file = import_filename
import.db = temporary_import_table
import.skip_lines = 0
import.skip_bytes = 0
import.field_sep = ","
import.record_sep = "<CR><LF>"
import.text_qualifier = "\""
import.record_len = 87
import.rem_blanks = .F.
import.escape_newlines = .F.
import.fields = 8
import.field1 = "hhnbr,c,0,16,0"
import.field2 = "policynbr,c,1,16,0"
import.field3 = "last_name,c,2,30,0"
import.field4 = "first_name,c,3,25,0"
import.field5 = "gender,c,4,7,0"
import.field6 = "birthday,d,5,8,0"
import.field7 = "pref150rate,n,6,9,2"
import.field8 = "age,n,7,2,0"
import()
a_tbl = table.open(import_destination_table)
append.t_db = temporary_import_table
append.m_key = ""
append.t_key = ""
append.m_filter = ""
append.t_filter = ""
append.type = "All"
append.m_count = 8
append.m_field1 = "HHNBR"
append.m_exp1 = "@driver_temp_table->HHNBR"
append.m_field2 = "POLICYNBR"
append.m_exp2 = "@driver_temp_table->POLICYNBR"
append.m_field3 = "LAST_NAME"
append.m_exp3 = "@driver_temp_table->LAST_NAME"
append.m_field4 = "FIRST_NAME"
append.m_exp4 = "@driver_temp_table->FIRST_NAME"
append.m_field5 = "GENDER"
append.m_exp5 = "@driver_temp_table->GENDER"
append.m_field6 = "BIRTHDAY"
append.m_exp6 = "@driver_temp_table->BIRTHDAY"
append.m_field7 = "PREF150RATE"
append.m_exp7 = "@driver_temp_table->PREF150RATE"
append.m_field8 = "AGE"
append.m_exp8 = "@driver_temp_table->AGE"
append.t_count = 0
a_tbl.append()
GOTO CONTINUE2202200718596562
ERROR2202200718596562:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Import Operation"+crlf()+error_text_get())
END
CONTINUE2202200718596562:
a_tbl.close()
'In case the destination table is not already in the Database, add it...
file_add_to_db(table.filename_get(import_destination_table))
'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
I have tried a variety of approaches to get data from table A in a master database into a smaller database that is a mirror of the larger (just smaller).
Every time I run an Append data or Import I get the message.
The image ExportTable is the structure from the larger table. The image ImportTable is the structure of the smaller table.
The numeric fields in the receiving table are not too large as numeric fields.
The unusual part of the operation is that when I click the OK button on the error message and then review the table all the data is in the table as it should be. I can find no number in any numeric field larger than 3 digits (plus 2 decimals. In any table in the entire set there is no field with a number larger than 4 digits.
Any suggestions as to where I should look or what the problem might be?
The code for the import is as follows and is generated from the import genie versus me doing the hard code.
temporary_import_table = file.temp_path_get()+ "driver_temp_table.dbf"
import_destination_table = "driver"
import_filename = filename_decode("[exe_folder]files\districts\central\27\districtexportdriver.txt")
if file.exists(import_filename) = .f. then
ui_msg_box("Error","File to import not found: '"+import_filename+"'.",ui_stop_symbol)
end
end if
ON ERROR GOTO ERROR2202200718596562
import.type = 0
import.names = "use"
import.file = import_filename
import.db = temporary_import_table
import.skip_lines = 0
import.skip_bytes = 0
import.field_sep = ","
import.record_sep = "<CR><LF>"
import.text_qualifier = "\""
import.record_len = 87
import.rem_blanks = .F.
import.escape_newlines = .F.
import.fields = 8
import.field1 = "hhnbr,c,0,16,0"
import.field2 = "policynbr,c,1,16,0"
import.field3 = "last_name,c,2,30,0"
import.field4 = "first_name,c,3,25,0"
import.field5 = "gender,c,4,7,0"
import.field6 = "birthday,d,5,8,0"
import.field7 = "pref150rate,n,6,9,2"
import.field8 = "age,n,7,2,0"
import()
a_tbl = table.open(import_destination_table)
append.t_db = temporary_import_table
append.m_key = ""
append.t_key = ""
append.m_filter = ""
append.t_filter = ""
append.type = "All"
append.m_count = 8
append.m_field1 = "HHNBR"
append.m_exp1 = "@driver_temp_table->HHNBR"
append.m_field2 = "POLICYNBR"
append.m_exp2 = "@driver_temp_table->POLICYNBR"
append.m_field3 = "LAST_NAME"
append.m_exp3 = "@driver_temp_table->LAST_NAME"
append.m_field4 = "FIRST_NAME"
append.m_exp4 = "@driver_temp_table->FIRST_NAME"
append.m_field5 = "GENDER"
append.m_exp5 = "@driver_temp_table->GENDER"
append.m_field6 = "BIRTHDAY"
append.m_exp6 = "@driver_temp_table->BIRTHDAY"
append.m_field7 = "PREF150RATE"
append.m_exp7 = "@driver_temp_table->PREF150RATE"
append.m_field8 = "AGE"
append.m_exp8 = "@driver_temp_table->AGE"
append.t_count = 0
a_tbl.append()
GOTO CONTINUE2202200718596562
ERROR2202200718596562:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Import Operation"+crlf()+error_text_get())
END
CONTINUE2202200718596562:
a_tbl.close()
'In case the destination table is not already in the Database, add it...
file_add_to_db(table.filename_get(import_destination_table))
'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
Comment