NeobookDBPro Rewriting last record issue - Forum

Forum Navigation
You need to log in to create posts and topics.

NeobookDBPro Rewriting last record issue

Hello,

I have a problem with NeobookDBPro.

Few days ago, for the first time i've tried to use SQL instead old DBF, so i tried with NeoDBpro to connect to the database and for some reason (probably too old Neobook version) will not connect to any sort of database. Then i reached for old NeobookDBpro, which work perfect.

Anyway,  i build up the simple database for personal asset tracking with NeobookDb few years ago and i wanted to do it in SQL.

Everything worked until i've tried to add another field using dbpCreateTable (at least then problems occured) and now, even if i recreate entire database, using SQL Express 2008-2016, the last record (mostly) or any other selected record, even when dbpLast is used, gets overwriten. It just wont go to another row, only overwrite last record or selected.

I removed that added field from everywhere, but still, allways overwrite the last or selected record.

Any ideas ?

Thx

@nypercro please note that NeoDBpro plugin is, as far as I know, the only plugin that needs to work with VisualNEO Win. It will fail if you use it with NeoBook.

If you need or prefer to work with NeoBook, it's mandatory to use NeoBookDBpro instead of NeoDBpro. You can find more information in the FAQ section here on the forums.

Not sure, but this will probably fix your issues. Please confirm.

Best regards.

First you need to add a new empty record if the record is not empty.
dbpAddRecord "Base" "Table"

Then assign values ​​to variables.

And at the end save the record.
dbpSaveEdits "Base" "Table"

Or go to any other record. For instance:
dbpFirst "base" "Table"

@nypercro

Are you from Croatia?

Da li trebas plugin za Neobook ili za VisualNeo ?

Ja imam  NeoDBPro plugin za Neobook....

 

Pozz...

@luishp yes, i figured it out once i tried :)
I hope will upgrade this year

Maybe i didnt explain very well, @luishp

So, connection works with old NeobookDBpro, but when i use dbpAddRecord, it rewrites last record in database

Code goes something like this :

dbpLast "DatabaseDB" "AssetBook"

SetVar "[DatabaseDB.AssetBook.Name]" "[ContainerAssetBookNameField]"

(....and few more Vars in order)

dbpAddRecord "DatabaseDB" "AssetBook"

Before i used "dbfAddRecord" and it works perfect, but i wanted to switch to SQL or Access

 

@mishem

I didnt try that. It goes with sample of code i wrote here ?

@dglojnar

Sta me izdalo da sam ih Hrvatske :D

Neobook, jer njega imam, ovaj drugi nisam jos kupovao

 

@nypercro

dbpLast "DatabaseDB" "AssetBook"

dbpAddRecord "DatabaseDB" "AssetBook"

SetVar "[DatabaseDB.AssetBook.Name]" "[ContainerAssetBookNameField]"

......

mishem

Variables to be written in database using dbpAddRecord goes after that command ?
I will try that.

It is better to first check the record. For example, in your database there is a "Name" field. Which should always be filled. Then:

dbpLast "DatabaseDB" "AssetBook"
If "[DatabaseDB.AssetBook.Name]" "<>" ""
dbpAddRecord "DatabaseDB" "AssetBook"
EndIf
SetVar "[DatabaseDB.AssetBook.Name]" "[ContainerAssetBookNameField]"
(....and few more Vars in order)

dbpSaveEdits "DatabaseDB" "AssetBook"

Or

dbpFirst "DatabaseDB" "AssetBook"

luishp and Vadim have reacted to this post.
luishpVadim

That solved my problem as i can see, i entered few random things to verify.
Now it sorts little different, from new to old, but that is not important.

Thank You :)

@nypercro

Super da je jos netko na Forumu iz Hrvatske:-)

Da li dugo koristis Neobook ?

Ja ga koristim od 1993...nikada nisam pozalio...isplatio se 1000 puta :-)

Pozz!

@dglojnar I have edited your post. Please read the forum rules. It's not allowed to publish anything that can damage SinLios or third party copyrights or interests. In any language.

Thank you for your understanding.

@luishp

No problem, mea culpa....

It was not my intention to damage SinLios  / 3rd party copyrights, wan't happend again:-)

 

Cheers!

luishp has reacted to this post.
luishp

@nypercro

Now it sorts little different, from new to old, but that is not important

dbpSort "database id" "table" "sort info"

From the help file ...

sort info
The name of the field or group of fields to use for the sort. Each field name must be followed by an equal sign and a direction keyword (ASC for ascending order or DESC for descending order). If multiple fields are used they should be separated by semicolons (;). For example, the following will sort by State in ascending order (A-Z), then sort by City in descending order (Z-A):

"State=ASC;City=DESC"