Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to locate the table while importing
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00406624
Message ID:
00406680
Views:
37
Juan,
By some miracle....the text data is moving over to the table. but still working on retrieving the correct positions. data only moves from the beginning of the line and not from position 31. trying the follow code...let me know if you have any ideas (always love your advise)
Kelly
1: this locates the existing table

Open Database xxxxxxxx EXCLUSIVE
thisform.EName.value = GETFILE("DBF")
return

2: this locates source text file and imports to table with set positions.

close data all
Open Database fibercomm EXCLUSIVE
use (Alltrim(thisform.EName.value))

cfile=Getfile("*","Open the text File","Open",0)
thisform.SFile.value = cfile
=Fclose(cfile)
Append From &cfile type SDF
nhdl=Fopen(cfile,10)
IF nhdl < 0
messagebox("Cannot Open File")
ELSE
messagebox("Source File Open")
nsize=Fseek(nhdl,1,2) && Move to EOF
IF nsize<=0
*- File is empty
ELSE
nsize=FSeek(nhdl,0,0) && Move to BOF
DO WHILE !FEOF(nhdl)
cString=FGETS(nhdl, 185)

cStr1=Substr(cString, 1, 30)
orig_lata=Substr(cString,31,3)
cStr2=Substr(cString, 34, 44)
term_lata=Substr(cString,78,3)
Bill_dur=Substr(cString,81,5)
cStr2=Substr(cString, 86)
ENDDO
ENDIF
ENDIF
*=fclose(nhdl)
=Fclose(cfile)
MessageBox ("Copy is done")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform