|
|||
|
It's depend on the type of the cursor. The Connection.Execute method returns a forward only cursor, you cannot use it to get the record count, move to the previous record or move to the first record.
You can create a static cursor to get the count of the records. Our sample is not so good, and sorry for our poor documentations. A sample about fetching data from MS SQL Sever has been sent to you. Please check mail. |
|
|||
|
Sorry to bother you again.
Thanks for the demo's you made for me. With the static cursor,I'm able to goto the last record ,.. But this problem occured: The update sql doesn't work anymore. I'm adressing it this way Code:
if (!rs.EOF)
{
FlashPlayer.updateData(true);
var sql = "update algemeen set naam='" + pla.naam +"', adres='" + pla.adres + "', openingsuren='" + pla.openingsuren + "' where Id=" +pla.nummer;
trace(sql)
conn.Execute(sql);
rs.MoveNext();
if (!rs.EOF) displayItems(pla, rs);
}
Should I adress it differently with the static cursor. The trace window doesn't report an error when I call the command, but the data doesn't change in my database. |
|
|||
|
I figured it out, but it isn't the way I want it to be
When I use the update function, the update function works, but only if I do another select query afterwards. I'm trying to make a simple acces form where the data the users change should be saved directly in the database. so when they browse the records, left or right, the update command should be executed. But when browsing, the old data is shown and saved. If I just save, without browsing, the data has changed in the mdb-file an d is showed the next time I do the select query. Is this the standard procedure (before swfkit, I 'ld never dealth with sql) ? I could live with that, but then I have to write a function that keeps track of the last record viewed Or is there another - simpler - solution. |
|
|||
|
This is a simpler way:
Code:
function UpdateItems(pla, rs)
{
pla.updateData(true);
rs.Fields["veld1"].Value =pla.veld1;
rs.Fields["veld2"].Value =pla.veld2;
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|