Database Query Builder?

Jan Schenkel janschenkel at yahoo.com
Fri Jun 13 12:04:21 EDT 2003


--- Marvin Wurth <jenworth at mhtc.net> wrote:
> I am building a standalone Revolution frontend
> application for a MySQL
> database.  I would like to use the Database Query
> Builder to build the
> queries and connect the various fields.  I have a
> good handle on how to
> use the Database Query Builder and to set everything
> up.  The problem is
> how do I allow the user to change the database
> connection information
> built by the Database Query Builder in a standalone?
>  The user will have
> to change the Host, User, and Password to match
> their needs.  Is there 
> a way to use the
> revOpenDatabase to open the database ID that will be
> used by the query
> build by the Database Query Builder?  Any
> suggestions or assistance 
> would
> be appreciated.  Thanks.
> 

Hi Marvin,

Here's the deal :  the connection details are stored
per query ; so you'll have to iterate over the
queries, change the connection details and update
everything.

Code snippet :

on UpdateAllDBConnections pDBType, pDBHost,
pDBDatabase, pDBPort, pDBUser, pDBPassword
  put revQueryObjects() into tQueryObjects
  repeat for each line tQuery in tQueryObjects
    Update1DBConnection tObject, pDBType, pDBHost,
pDBDatabase, pDBPort, pDBUser, pDBPassword
  end repeat
end UpdateAllDBConnections

on Update1DBConnection pObject, pDBType, pDBHost,
pDBDatabase, pDBPort, pDBUser, pDBPassword
  set the cREVDatabaseQuery["dbtype"] of pObject to
pDBType
  set the cREVDatabaseQuery["dbhost"] of pObject to
pDBHost
  set the cREVDatabaseQuery["dbdatabase"] of pObject
to pDBDatabase
  set the cREVDatabaseQuery["dbport"] of pObject to
pDBPort
  set the cREVDatabaseQuery["dbuser"] of pObject to
pDBUser
  set the cREVDatabaseQuery["dbpassword"] of pObject
to pDBPassword
  revConnectQuery pObject
  revRefreshQuery pObject
end Update1DBConnection

Hope this helped,

Jan Schenkel.

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

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com



More information about the use-livecode mailing list