1. Stan Busk
  2. Valentina Database ADK
  3. Суббота, Август 29 2020, 07:34 AM
  4.  Подписаться через email
A customer sent me a Valentina database that seems corrupt. It is very slow to load but I can finally do it with the software that created it. However, Valentina Studio says it is not a valid database.

Where can I sent that database so it can be checked?
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
You can send it to me - ivan_smahin at valentina-db.com
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Strange but I was able to open db with vStudio without any issue. Neither slowness nor errors. Diagnose says everything is ok.
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
Bad news then, I can't do almost anything with the file and the customer even less.

After a few hours, I was able to delete 3 entries with RecID #0. It is normal that 3 records could have the same #0 ID?

What did you do to open the FIle with vStudio? I can't here, it simply says it is not a valid database. maybe I am using the wrong menu?
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Just File/Open Database - nothing special.
Could you tell me what exactly you are trying to do - so, I would try to reproduce it here?
Latest vStudio, macOS.

About the same recID for different rows. Generally, it is possible.
- after Clone, LoadDump;
- after "DELETE FROM t1 WHERE RecID = x" - the "x" will be marked as deleted record (and may be reused by next INSERT statement).
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
I found out right that the VTable.RecordExists( RecID ) is returning false on many records in that database. I then do a SQL query for those RecID and they are returned normally. I think my problem is definitely with the VTable.RecordExists( RecID ) function.Weird. It is fully verifiable on my app, I have tried to isolate this in a sample app unsuccessfully. The customer still can't use the file.
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
So you can not reproduce it with another app on the same db?
And I'm afraid I don't get it right - you also can not open that db with vStudio? Just File/Open Database, than check "all files" in the dialog...
It was not any issue on my side.
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Can you send me your app? Or it is too hard to build it and debug on my side?
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
Here is a minimalist Xojo project you just have to load and run, I hope: https://jmp.sh/yI2s4VP
Button 1 just run the query in the edit field.
Button 2 do a VTable.RecordExists() for records 131017 To 181284, 38175 records are returned as not valid but with the query field you can check they are in the DB.
Button 3 run a function read and rewrite data on the same records, it returns 6418 nil Object exceptions
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
moValentinaTools Missing File '..\..\..\..\_libraries\Modules\moValentinaTools.rbo' /Users/Maxprog/Developments/_libraries/Modules/moValentinaTools.rbo
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
Sorry, the file has been updated and re-uploaded here is the new link: https://jmp.sh/BRlXjec
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Ok, as far as I get it - you think that tblTransactions.recID == tblTransactions.transaction_Record ?

See PushButton3.Action


...
aRec = aCursor.ULongField( "Transaction_Record" ).Value
...
myDatabase.mTransaction.Change( _
myDatabase, _
aRec, _
...



myDatabase.mTransaction.Change(
inDatabase as DB_Data, inRec As Integer, inTransactionType As Integer, inCustomType As string, inDebitAccount As Integer, inCreditAccount As Integer, inAmount As Double, inComment As String, inDay As Integer )
...
If isValid( inRec ) then
...




isValid(inRec As Integer)
...
If RecordExists( inRec ) then
...
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят

SELECT recID FROM tblTransactions WHERE Transaction_Record = '176744'
-- 176446


And RecordExists( 176446 ) returns true as expected.
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
Good point, yes, Transaction_Record is supposed to contain a copy of RecID.

In a VCursor how can I get the RecID or a record?
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
Select recid, .... From ...
Select ** from ...
Комментарий
There are no comments made yet.
Stan Busk Ответ принят
Ok, thanks, I have reassigned the field with the correct value and all is fine now!
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.