Page 1 of 1

Any Real Database type examples?

Posted: Wed Apr 04, 2007 9:03 am
by PaulMacFarlane
I've seen the tutorials and they are all single table type applications.
I've never developed anything like that before. Most of my applications have 50 to 100 tables, etc.

Since I purchase RunRev a few months ago, I have been unable to get anywhere with it. There are no examples of a real contact management application (I don't consider the Contact Manager tutorial example - a date and name -much of an example - it actually doesn't even show how to create that 'application').

Whenever I connect to a SQL database via ODBC, the results initially seem fine (it connects and gets the table and column information), but if I try to run the stack, no data is displayed and I get constant messages the "hstmt is busy processing another request" whatever that means.

I've been trying to locate a multi-platform solution. I downloaded RealBasic and connected to my database, displayed a results list, etc. in about 15 minutes. And people tell me it sucks.

Does anyone develop real business applications in RunRev? Multi-table relational databases?
Maybe I still don't get the "stack/card" thing.
Should I be able to open a card and display a list/table of records?

Really lost and frustrated here...

Posted: Wed Apr 04, 2007 10:15 am
by Mark
Hi Paul,

Revolution is fully compatible with the supported databases and not just a little. Using revExecuteSql and revDataFromQuery, you can execute any command for each of the supported database types.

The Query builder, which allows you to display records, is rather limited, though. I haven't used the Query Builder but built my own front-ends for two of my projects. These are real-business examples with a relational database and one respectively two tables.

Why do you connect to a SQL database via ODBC? Shouldn't you connect to the SQL database directly? Which type of SQL engine are you using?

Although it was a bit of a struggle at the beginning, I really have come to appreciate Rev's database capabilities.

Best regards,

Mark

Posted: Wed Apr 04, 2007 5:52 pm
by PaulMacFarlane
Mark....

Its MS-Sql2000. It's an existing database so I don't have a choice. Is ODBC a problem? Is there a better way to access MSSql? I bot the pro version because Enterprise didn't add anything I needed and didn't see MSSql in it's specs..

Okay - so I need to ignore the Query Builder. and use the ExecuteSql method. I go that way. Sounds like a step in the right direction !

Thanks,
Paul

Posted: Wed Apr 04, 2007 8:15 pm
by paul_gr
Search the Rev list for database topics using this Google link::

http://www.google.com/advanced_search?q ... runrev.com

The list has been in existence for a long time and has accumulated a lot of info -- I get most of my Rev information there.
A prime resource.

Paul

Posted: Wed Apr 04, 2007 8:16 pm
by PaulMacFarlane
Okay...

So, I have a card with a Table field named "OpList" on it.

In the card script I have:

on opencard
get revOpenDatabase("ODBC","mydatabase","user","password")
put it into did
get revDataFromQuery(,, did, "select * from dbo.operator")
put it into OpList
end opencard

When I run the card I receive no messages and no data.

I found the online dictionary to contain definitions for the functions, but the examples aren't verbose enough.

Is there any example that actually puts these script elements together?

Is the OpenCard event the wrong place?

Posted: Wed Apr 04, 2007 10:24 pm
by Mark
Hi Paul,

Why do you keep the itemDelimiters empty in get revDataFromQuery(,, did, "select * from dbo.operator") ? What is in OpList?

Best,

Mark

Posted: Wed Apr 04, 2007 10:50 pm
by PaulMacFarlane
Good questions....

OpList is a Table Field on the card. How did I configure it? I didn't.
I can't find an example of loading data from a query into a table.
http://lists.runrev.com/pipermail/use-r ... 16229.html
Has some example I was going to try next in it's "transcriptList" event -it appears to load the data row by row and column by column.
Is that the correct way?

The item delimiters are emtpy in the example syntax. I assumed there was some sort of default and were only necessary if something different.
Not knowing what Rev sees in the results, I went with th default.

Posted: Wed Apr 04, 2007 11:41 pm
by PaulMacFarlane
Okay,

Now I've figured out that the script was never really executing anyway because it part of the OpenCard event and I need to close the card before that event executes. cute...

Now I get an error.
Type: Function: error in function handler
Line: get revOpenDatabase("ODBC","mydatabase","user","password")
Hint: revOpenDatabase

So, 15 minutes of searching and I cannot figure out what "error in function handler" means.

But did finally did notice that the ODBC example has 2 commas after the DSN name in it's parameters. Rev sure likes empty parameters..!

So, my script is now executing but I'm getting nothing loaded into my table field....