VCurson.ImportText questions

va_refinancing at mail.com va_refinancing at mail.com
Fri Jun 18 16:21:45 CDT 2004


Can anyone point out where this REALbasic and Valentina (and MacOS)
newbie went wrong with the following?  I have a test file on OS X
that looks like this:

1,2,3
2,3,4
3,4,5

And I have the following code to have a go at using ImportText
(mDatabase is a valid database object):

  Dim result As Integer
  result = mDatabase.SQLExecute("CREATE TABLE test (col1 long,
col2 long, col3 long)")
  If mDatabase.ErrNumber <> 0 Then
    MsgBox("Valentina error " + Str(mDatabase.ErrNumber) +
": " + mDatabase.ErrString)
  End If
  
  Dim theImportFile As FolderItem
  Dim theImportCursor As VCursor
  Dim iError As Integer
  theImportCursor = mDataBase.SqlSelect("SELECT * FROM
test", kClient, kReadWrite, kRandom)
  theImportFile = GetOpenFolderItem("text")
  If theImportFile <> Nil Then
    theImportCursor.ImportText(theImportFile, ",")
    mDatabase.Flush
    iError = mDatabase.ErrNumber
    If iError <> 0 Then
      MsgBox("Valentina import error #" + Str(iError) +
": " + mDatabase.ErrString)
    End If
  End If


When I execute this code, the table is created successfully, but
there is no data in the table when I select from it.  Any ideas where
I've gone wrong?  I've tried this with tables containing only a
single column, with tab delimited text files, and several other
variations, all with the same result.  I don't get any errors (that I
can detect), but I never see any of the imported data in my table.  I
have some much larger files that I need to import, but I can't even
get a simple example to work.

Thanks,

Jon
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



More information about the Valentina mailing list