Hi there,
Plenty of Rev developers build database front-ends. Some of the questions you are asking, are not straightforward to answer.
The key thing to remember is that Revolution is a tool to build destkop applications, which sports extensions to connect to databases. It is not PHP or ASP.NET - but no single programming language has it all without a learning curve.
Maybe it's best if you follow the Revolution User Guide (which you can open from the documentation), and download Srah Reichelt's examples here:
http://www.troz.net/Rev/tutorials.php
Let's start with table column headers: they're not supported by the core product, but you can download the altFldHeader plugin here:
http://www.altuit.com/webs/altuit2/altP ... nloads.htm
On to navigation between stacks: the 'go' command is your friend here. So your 'Add a new record' button should have a script like this:
Code: Select all
on mouseUp
go stack "RecordEditor"
-- add some code to reset the data in the editor stack
...
end mouseUp
An here's how you can react to a doubleclick on a list field, by adding a 'mouseDoubleUp' handler to your field's script:
Code: Select all
on mouseDoubleUp
put the hilitedLine of me into tLine
go stack "RecordEditor" -- the name of your editor stack
-- now do something to initialize the stack
...
end mouseDoubleUp
If you want to make sure the user can't click on other windows in your application while editing a record, use the 'go ... as modal' variant.
Actually creating a record in your database table will involve some SQL. You collect the data that the user entered, run a database query to insert the record, and then refresh your table. So your "Save" button would have a script like:
Code: Select all
on mouseUp
-- assuming the database connection is stored in this global variable
global gDatabaseConnection
-- read the data the user inserted
put field "FirstName" into tFirstName
put field "LastName" into tLastName
put field "EmailAddress" into tEmailAddress
-- now prepare our query
put "INSERT INTO Customer" && \
"(FirstName, LastName, EmailAddress)" && \
"VALUES (:1,:2,:3)" into tSqlQuery
-- next execute our query
revExecuteSQL gDatabaseConnection, tSqlQuery, "tFirstName", "tLastName", "tEmailAddress"
-- finally close the editor stack
close this stack
end mouseUp
Hope this gets you started,
Jan Schenkel.