Importing data from tabbed delimited files
Caliste
caliste_l at yahoo.fr
Tue Sep 16 02:00:50 CDT 2008
curs=gDB.SqlSelect( "SELECT * FROM ..", #kClientSide, #kNoLocks )
#kNoLocks => put the flasg to read/write for 'curs'
Regards,
Caliste
----- Message d'origine ----
De : Irv Kalb <Irv at furrypants.com>
À : Valentina Developers <valentina at lists.macserve.net>
Envoyé le : Mardi, 16 Septembre 2008, 7h25mn 24s
Objet : Importing data from tabbed delimited files
Hi,
Long time Director developer, just starting to use Valentina. I'm
porting a set of old applications from V12 to Valentina.
My client creates a number of text files by building spreadsheets in
Excel, then exporting them as tabbed delimited files. I want to run
through this set of files, and build a table for each file. I found
the ImportText command in the Import_Export example and I'm hoping
that this is the proper way to do this.
I have created a database file and I want to read a simple file
called "Feedback", which consists of just two text strings in each
line, like this:
POSITIVE NEGATIVE
Excellent No way
Good job Sorry
Great going Oops
Good Incorrect
That's right Try again
The file is called "Feedback.txt" and is in the same directory as the
application. Here is the code that I am trying to use:
oFeedbackTable = gDb.createTable("Feedback")
if CheckValError() then exit
lPos = oFeedbackTable.createStringField("POSITIVE", 40)
if CheckValError() then exit
lNeg = oFeedbackTable.createStringField("NEGATIVE", 40)
if CheckValError() then exit
curs = gDB.SqlSelect( "SELECT * FROM Feedback WHERE FALSE" )
curs.ImportText(the moviePath & "Feedback.txt", TAB, numToChar(13), "", TRUE)
Everything seems fine up to the ImportText command. When that
executes, I get an error for every line saying that the cursor is
read only:
More information about the Valentina
mailing list