VCurson.ImportText questions

va_refinancing at mail.com va_refinancing at mail.com
Mon Jun 21 11:35:32 CDT 2004


>> Dim theImportFile As FolderItem
>> Dim theImportCursor As VCursor
>> Dim iError As Integer
>> theImportCursor = mDataBase.SqlSelect("SELECT * FROM
>> test", kClient, kReadWrite, kRandom)
>^^^^^^^ mistake
>
> kClient cursor is always read only,
> even if in second parameter you write ReadWrite.
> 
> ClientSide cursor always read only.

Ruslan,

I would have anticipated some sort of error condition if I attempted to import into a read-only cursor.  I changed kClient to kServer, but I still encounter the same problem.  I try to run the import, and while I get no errors reported from Valentina, nothing is imported into the table.  Is there something else that I'm doing wrong here?  Here's the modified code:

  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
  
  theImportCursor = mDataBase.SqlSelect("SELECT * FROM test", kServer, kReadWrite, kRandom)
  
  theImportFile = GetOpenFolderItem("")
  If theImportFile <> Nil Then
    theImportCursor.ImportText(theImportFile, ",")
    If mDatabase.ErrNumber <> 0 Then
      MsgBox("Valentina import error #" + Str(mDatabase.ErrNumber) + ": " + mDatabase.ErrString)
    End If
    mDatabase.Flush
  End If
  

If anyone can point me to a simple example of using ImportText, I'd love to look it over.  As it is, I'm stumped...

Thanks,

Jon


P.S. - Sorry to all for the typo in the subject line.  It obviously should have been VCursor.ImportText (in case anyone uses a text search for this topic in the future...).
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



More information about the Valentina mailing list