How to fill in the Database Query Builder?

Reinhold Venzl-Schubert r.venzl-schubert at t-online.de
Sun Jun 4 02:08:34 EDT 2006


Hi!

My trial to build a Database Query to an altSQLite-Database fails,  
but Revolution stores it somewhere. Because when I save my stack and  
open it again, I got the same error message and the Database Query  
Builder shows me the failed Query.

Therefore I looked for the place where Revolution stores the failed  
query. I expected to find a script anywhere and wanted to look at it  
to find a mistake. But I did not find neither a script nor anything  
else. I used "Analyse it..." of "2lz2" from Klaus Major for my search.

  Where is a Database Query stored in the stack?

Reinhold

> Hi!
>
> I just go my first steps in using database with Revolution.
> I bought a license von SQLite from Altuit and created my first
> database "AppReg3.db"
>
> Then I created a stack and want to build a database query with the
> Database Query Builder.
> I studied the User Guide and the appropriated video but I cannot
> connect to the db.
> Whatever I tried I got the message:
>
> There was an error in connecting to the database.
> Please check that the connection fields are correct.
> Revdb error: revdberr, invalid database type
>
> Please give me a little help to fill in correctly:
>
> Name:        Query 1
> Type:          altSQLite3
> Host:           ?
> Database:  ?
> User:            my emailadress that I used to create the AppReg3.db
> Password:  my password that I used to create the AppReg3.db
>
> The database is located in the folder "/Applications/Revolution
> Studio/2.7.1-gm-1"
> The stack is located in the folder "/Users/rvs/Documents/My
> Revolution Studio/Programme"
>
> - - - - - - - - - - - - - - -
> The script I created the AppReg3.db is:
>
> on mouseUp
>      global gConID
>      put revdb_connect("sqlite3","AppReg3.db",,,,,"schubert at t-
> online.de","XXxxXXxxxXxxXX") into tConID
>      if tConID is "" then
>          answer warning "Problem creating or accessing database!"
>      else
>          answer information "AppReg Connected! Your connection ID is:
> " & tConID
>          put tConID into gConID
>      end if
> end mouseUp
>
> - - - - - - - - - - - - - - - -
> The script I created the table is:
>
> on handleRevDBerror p
>    switch
>    case item 1 of p is "revdberr"
>      return "revDB Error: " & p
>      break
>    case "syntax error" is in p
>      return "Database Error: " & p
>      break
>    end switch
> end handleRevDBerror
>
> on mouseUp
>      global gConID
>      if gConID is "" then
>          answer information "No Database is Connected to, please go
> back 1 step and connect to the Database!"
>          exit mouseUp
>      end if
>      put "CREATE TABLE Karten_Daten(KarteID integer primary key,Frage
> text,Antwort text)" into tSQL
>      put revdb_execute(gConID,tSQL) into tTmp
>      handleRevDBerror tTmp
>      if the result is not empty then
>          answer warning the result
>          exit mouseUp
>      end if
>      answer information "Number of Tables Added: " & tTmp
> end mouseUp
>
> Thanks
> Reinhold Venzl-Schubert




More information about the use-livecode mailing list