Hi Folks,

I've read through the archives in hopes of answering this, but my search hasn't 
resolved this issue.

I use the following code to read a text file and import the data within the 
text 
into a database (CatalogDB is available and the connection succeeds):

  Dim curRecord As New DatabaseRecord
  Dim rs As New RecordSet
  Dim f As FolderItem
  Dim fs As TextInputStream
  Dim curline, thePath, theFile As String
  
  f = GetFolderItem("/private/tmp/runoutput1.log", _
    FolderItem.PathTypeShell)
  
  fs = f.OpenAsTextFile
  
  While Not fs.EOF
    curline = fs.ReadLine
    If Left(curline, 3) = "VL:" Then
      // This gets the full file and path from the text file
      thePath = NthField(curline, "|", 6)
      // this gets the files path (dirname)
      thePath = dirname(thePath)
      // send the result to my Debug class
      Debug.Print "SQL Select: " + "select * from paths where pathname='" _
        + thePath + "'"
      rs = CatalogDB.SQLSelect("select * from paths where pathname='" _
        + thePath + "'")
      if CatalogDB.Error Then
        Debug.Print "No matching records in paths table"
        EditField1.SelText = thePath + EndOfLine
        curRecord.Column("pathname") = thePath
        CatalogDB.InsertRecord("paths", curRecord)
        CatalogDB.Commit
      Else
        Debug.Print "Recordset count = " + Str(rs.FieldCount)
        Editfield1.SelText = "Path entry is " + rs.Field("pathid").Value _
          + EndOfLine
      End If
    End If
  Wend

What I'm hoping to achieve is to examine the path for each file that exists in 
the text file.  Compare it against the paths already entered into the database 
table "paths" in the CatalogDB.  If the path exists, return the Index, 
otherwise 
insert the entry as a new pathname entry.

I'm getting the appropriate error from the select if the path isn't found, but 
the insert isn't working (verified with SQLiteManager).  However, if I add a 
Debug.Print of the "CatalogDB.LastRowID" the RowID appears to be incrementing.

Any pointers as to what I'm missing?

Thanks,

Tim
--
Tim Jones
[EMAIL PROTECTED]

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to