I am trying to have a web dialog that asks for a name of a flatfile, and from that import certain fields into a form. I have designed the import but i have no idea on how to make the import ask for a file name. The flat file always in the same file folder and would always be a .txt file I am attaching the xbasic code for all to have a peek.
import.type = 0
import.names = "none"
import.file = "d:\021812859.txt This is the line where i would assume the ask would be found
import.db = "c:\test actos\new_temp_table.dbf"
import.skip_lines = 1
import.skip_bytes = 0
import.field_sep = ","
import.record_sep = "<CR><LF>"
import.text_qualifier = "\""
import.record_len = 0
import.rem_blanks = .F.
import.escape_newlines = .F.
import.import_encoding = "default"
import.fields = 13
import.field1 = "activation_number,c,1,8,0"
import.field2 = "first_name,c,4,15,0"
import.field3 = "last_name,c,6,15,0"
import.field4 = "cell_number,c,8,10,0"
import.field5 = "esn,c,9,14,0"
import.field6 = "term,c,13,2,0"
import.field7 = "rate_plan,c,14,12,0"
import.field8 = "field_16,c,15,1,0"
import.field9 = "field_17,c,16,9,0"
import.field10 = "field_18,c,17,6,0"
import.field11 = "field_19,c,18,6,0"
import.field12 = "field_20,c,19,7,0"
import.field13 = "field_21,c,20,9,0"
import()
a_tbl = table.current()
append.t_db = "c:\test actos\new_temp_table.DBF"
append.m_key = ""
append.t_key = ""
append.m_filter = ""
append.t_filter = ""
append.type = "All"
append.m_count = 13
append.m_field1 = "ACTIVATION_NUMBER"
append.m_exp1 = "@new_temp_table->ACTIVATION_NUMBER"
append.m_field2 = "FIRST_NAME"
append.m_exp2 = "@new_temp_table->FIRST_NAME"
append.m_field3 = "LAST_NAME"
append.m_exp3 = "@new_temp_table->LAST_NAME"
append.m_field4 = "CELL_NUMBER"
append.m_exp4 = "@new_temp_table->CELL_NUMBER"
append.m_field5 = "ESN"
append.m_exp5 = "@new_temp_table->ESN"
append.m_field6 = "TERM"
append.m_exp6 = "@new_temp_table->TERM"
append.m_field7 = "RATE_PLAN"
append.m_exp7 = "@new_temp_table->RATE_PLAN"
append.m_field8 = "FIELD_16"
append.m_exp8 = "@new_temp_table->FIELD_16"
append.m_field9 = "FIELD_17"
append.m_exp9 = "@new_temp_table->FIELD_17"
append.m_field10 = "FIELD_18"
append.m_exp10 = "@new_temp_table->FIELD_18"
append.m_field11 = "FIELD_19"
append.m_exp11 = "@new_temp_table->FIELD_19"
append.m_field12 = "FIELD_20"
append.m_exp12 = "@new_temp_table->FIELD_20"
append.m_field13 = "FIELD_21"
append.m_exp13 = "@new_temp_table->FIELD_21"
append.t_count = 0
a_tbl.append()
import.type = 0
import.names = "none"
import.file = "d:\021812859.txt This is the line where i would assume the ask would be found
import.db = "c:\test actos\new_temp_table.dbf"
import.skip_lines = 1
import.skip_bytes = 0
import.field_sep = ","
import.record_sep = "<CR><LF>"
import.text_qualifier = "\""
import.record_len = 0
import.rem_blanks = .F.
import.escape_newlines = .F.
import.import_encoding = "default"
import.fields = 13
import.field1 = "activation_number,c,1,8,0"
import.field2 = "first_name,c,4,15,0"
import.field3 = "last_name,c,6,15,0"
import.field4 = "cell_number,c,8,10,0"
import.field5 = "esn,c,9,14,0"
import.field6 = "term,c,13,2,0"
import.field7 = "rate_plan,c,14,12,0"
import.field8 = "field_16,c,15,1,0"
import.field9 = "field_17,c,16,9,0"
import.field10 = "field_18,c,17,6,0"
import.field11 = "field_19,c,18,6,0"
import.field12 = "field_20,c,19,7,0"
import.field13 = "field_21,c,20,9,0"
import()
a_tbl = table.current()
append.t_db = "c:\test actos\new_temp_table.DBF"
append.m_key = ""
append.t_key = ""
append.m_filter = ""
append.t_filter = ""
append.type = "All"
append.m_count = 13
append.m_field1 = "ACTIVATION_NUMBER"
append.m_exp1 = "@new_temp_table->ACTIVATION_NUMBER"
append.m_field2 = "FIRST_NAME"
append.m_exp2 = "@new_temp_table->FIRST_NAME"
append.m_field3 = "LAST_NAME"
append.m_exp3 = "@new_temp_table->LAST_NAME"
append.m_field4 = "CELL_NUMBER"
append.m_exp4 = "@new_temp_table->CELL_NUMBER"
append.m_field5 = "ESN"
append.m_exp5 = "@new_temp_table->ESN"
append.m_field6 = "TERM"
append.m_exp6 = "@new_temp_table->TERM"
append.m_field7 = "RATE_PLAN"
append.m_exp7 = "@new_temp_table->RATE_PLAN"
append.m_field8 = "FIELD_16"
append.m_exp8 = "@new_temp_table->FIELD_16"
append.m_field9 = "FIELD_17"
append.m_exp9 = "@new_temp_table->FIELD_17"
append.m_field10 = "FIELD_18"
append.m_exp10 = "@new_temp_table->FIELD_18"
append.m_field11 = "FIELD_19"
append.m_exp11 = "@new_temp_table->FIELD_19"
append.m_field12 = "FIELD_20"
append.m_exp12 = "@new_temp_table->FIELD_20"
append.m_field13 = "FIELD_21"
append.m_exp13 = "@new_temp_table->FIELD_21"
append.t_count = 0
a_tbl.append()
Comment