Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-10-2003, 06:09 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default database last record

I noticed in the database sample, that within the "forward" command, the idx of the last record was given.
Is there a way in Ffish to automaticly detect and show the last record of a tabel?
Reply With Quote
  #2 (permalink)  
Old 09-10-2003, 03:49 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:database last record

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.
Reply With Quote
  #3 (permalink)  
Old 10-01-2003, 05:34 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re:database last record

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);
}
Am I doing somthing wrong,
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.
Reply With Quote
  #4 (permalink)  
Old 10-02-2003, 02:33 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:database last record

Hi,

It works. Please don't pack the db file into the output exe.
Reply With Quote
  #5 (permalink)  
Old 10-10-2003, 11:05 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re:database last record

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.

Reply With Quote
  #6 (permalink)  
Old 10-11-2003, 07:06 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re:database last record

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;
}
I just call the UpdateItems function,each time I go forward or backwards

Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:25 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.