1. Roger
  2. Valentina Database ADK
  3. 水, 8月 12 2020, 06:38 PM
  4.  メールで購読
Hello

I use serversidecursor in readwrite mode, then the record is locked in the table so far all works ok.

But then I use other function (like a report) but the cursor is with all i tried not really unlocked. What is the best/correct way to unlock a record or a table? (Read first or next not helps, read all with kNoLocks not helps too)

Regards Roger
コメント
There are no comments made yet.
Roger 承諾済みの回答
Manhy thaks Ivan, now it works. :D
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
Please try following:


ReportValentina = ProjektValentina.MakeNewReport("Telefonliste", db, CommmandString, ECursorLocation.kClient, ELockType.kNoLocks )
コメント
There are no comments made yet.
Roger 承諾済みの回答
Before this coe in an other function I read an Adresse in readwrite mode, then its modified or not. The adresse at end I need to work more with it. - And this is my problem - In the last read in this code the Adresse is every time locked and I cannot see what is the problem.

To know - I have similar functions, the other functions the sql string contains pointers to an second table and this works all fine. The only difference is I read here only one table....


RecID = AdresseCursor.Field("RecID").Value

AdresseCursor = Nil

AdresseCursor = db.SqlSelect("SELECT ** FROM Adresse", _
EVCursorLocation.kServerSide, EVLockType.kNoLocks)

Projektname = GetFolderItem("solution.vsp")
ProjektValentina = new VProject(Connection, Projektname)
ProjektValentina.Open()

CommmandString = "SELECT * FROM Adresse "_
+ "WHERE Nachname > '' AND Adresstyp = '" + MainWindow.AdresstypPopupMenu.SelectedRowValue + "' "_
+ "ORDER BY Nachname ASC, Vorname ASC"

ReportValentina = ProjektValentina.MakeNewReport("Telefonliste", db, CommmandString)

Pfad = SpecialFolder.Documents.Child("x").Child("Telefonliste.pdf")
ReportValentina.PrintToDisk(Pfad, EVReportPrintType.kToPDF, 1 )

Pfad.Open

AdresseCursor = Nil

Statement = db.Prepare("SELECT ** FROM Adresse WHERE RecID = :1")
Statement.BindUInt32(0, RecID)

AdresseCursor = Statement.SqlSelect(EVCursorLocation.kServerSide, EVLockType.kReadWrite)

コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
What exactly do you mean by
I use other function (like a report)
?
kNoLocks is not locking the records at all. Also you may try clientSide cursor to avoid locking.
コメント
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.