update to 2.9? --

Jan Schenkel janschenkel at yahoo.com
Sat Apr 5 16:14:47 EDT 2008


--- william humphrey <shoreagent at gmail.com> wrote:
> I couldn't bring myself to roll-back and am still
> beating my head against
> the wall. I finally at least got the "there was an
> error connecting to the
> database" message to show up when entering the
> information into the database
> query builder. After hundreds of absolutely no
> result (except a crash or
> two) no matter what I did that is an improvement.
> I wish there were clear instructions on how this
> should be filled out. Even
> the pop-up is a little odd as it flips to altsqlite
> when you choose SQLite.
> There is also no indication of whether it only works
> with SQLite 3 or not.
> 
> I'm beginning to think there is some interesting
> stuff here to blog about.
> Why are the beginning stages of database access
> always really difficult?
> Think back to the early days of PHP and MySQL. The
> set-up was nearly always
> full of pitfalls which made the initial learning
> curve very steep and
> frustrating.
> 

First, I would suggest getting altsqlite out of the
equation. If you have a 'My Revolution Studio' or 'My
Revolution Enterprise' directory, rename that to see
if it clears things up.
Which platform are you running on, and which version?

Here's my set of steps on MacOSX Tiger:
- opened Revolution 2.9
- created a new empty stack
- opened the database query builder
- clicked the '+' button to create a new query
- changed the database type to 'SQLite'
- in the 'Host' field I entered "/sqlitest.db"
- I clicked 'Connect' and the connection opened fine, 
creating a new database at the root directory of my
hard disk
- of course, the database has no tables yet
- so next I dragged a button onto the stack, and set
its script to:
##
on mouseUp
  local tConnection, tQuery
  put revConnectionOfQuery("Query 1") into tConnection
  put "CREATE TABLE contacts (firstname,lastname)"
into tQuery
  revExecuteSQL tConnection, tQuery
end mouseUp
##
- I clicked the button and then went back to the
database query builder, where I switched to the
'Record set' tab
- now the name of my table shows up in the Table
combobox
- selecting it fills the query field with "SELECT *
FROM contacts"
- now i go back to my stack and add another button
with script
##
on mouseUp
  local tConnection, tQuery
  put revConnectionOfQuery("Query 1") into tConnection
  put "INSERT INTO contacts ('Foo','Bar')" into tQuery
  revExecuteSQL tConnection, tQuery
end mouseUp
##
- clicking the button added a record to our table, so
on to displaying it
- I dragged two text entry fields onto the stack,
opened the properties inspector and linked them to my
query, and picked the columns
- then I went back to the database query builder and
clicked "Refresh"
- lo and behold, the two fields were filled

Does this work for you?

Jan Schenkel.

Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com



More information about the use-livecode mailing list