[V4RB] Bug in UPDATE or ImportText or Flush?

Richard Altenburg valentina at brainchild.nl
Sun Mar 23 08:51:03 CST 2003


In my program I load thousands of newsgroup names, put them in a disk file,
and load them back into Valentina with the ImportText-method. This is a very
fast operation, so far so good...

After the importing, I use an SQL execution to set a field of the newly
created records to a given value. This field is an ObjectPtr, pointing to a
table with servers, one of them having the ID that I assign in this routine.

In the user interface, one should now choose that server in a popup-menu,
and all newsgroup names should appear. But they don't.

I have mentioned it before last week, and did various adjustments. And found
some strange behaviour. If I add the first server, and import thousands of
names for it, nothing appears on screen (but the data is there!). When I add
a second server, and import thousands of names for that, nothing appears for
the second server, but when I choose the first server on screen, now
suddenly all thousands of names for the first server appear on screen,
exactly how it should be. Now when I import names for a third server,
suddenly the names for the second server appear, but not that from the third
server. And so on, and on, and on...

Testin with Valentina APP, after the first server has been created, and his
groupnames have been imported, when I browse through the groupnames, the
linked server gets displayed. When I browse from the server-side, not linked
groupnames are being displayed!

When I add the second server, and import groupnames for that, suddenly when
I click on the first server, the linked groupnames do appear! The same
behaviour as in my own application.

Also, a test with viSQL shows some weird stuff. When I add the first server
with his groupnames, when I do a SQL SELECT * FROM AvailableGroup WHERE
server_recid=1 I get nothing, but when I do SELECT * FROM AvailableGroup
WHERE server_recid="1" I get them all!!! Mind the double quotes I have to
use, with single quotes I get nothing. But of course I should get them when
I use no quotes at all, it is a numeric value.

After importing a second thousands of groupnames for another server, the
first SQL SELECT, the one without the quotes, returns all the thousands of
names from the first server, which is the correct behaviour.

Please help me with this puzzle! Sample code is this:



vcsImportGroup=New VCursor(ppPiPaBase, "SELECT groupname FROM AvailableGroup
WHERE RecID=0")
        
If (vcsImportGroup<>Nil) Then
          
   ppPiPaBase.ppAvailableGroup.Groupname.Indexed=False
          
   vcsImportGroup.ImportText(fdiTemp, " ", (Chr(13)+Chr(10)))
          
   ppPiPaBase.ppAvailableGroup.Groupname.Indexed=True
          
   ppPiPaBase.Flush
          
   rowsAffected=ppPiPaBase.SqlExecute("UPDATE AvailableGroup SET
server_recid="+Format(serverIDInPopUpMenu, "############")+" WHERE
server_recid=0")
          
   ppPiPaBase.Flush
          
   vcsImportGroup=Nil



More information about the Valentina mailing list