VCurson.ImportText questions

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jun 19 09:09:56 CDT 2004


On 6/19/04 12:21 AM, "va_refinancing at mail.com" <va_refinancing at mail.com>
wrote:

Hi Jon,

> 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)
        ^^^^^^^ mistake

 kClient cursor is always read only,
    even if in second parameter you write ReadWrite.

ClientSide cursor always read only.


> 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

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list