TMySQLServer
  


CLASS TMySQLServer: Every available MySQL server

Instance variables

:nSocket
Connection handle to server (currently pointer to a MYSQL structure)

:cServer
Server name

:cDBName
Selected DB

:cUser
User accessing db

:cPassword
His/her password

:lError
.T. if occurred an error

:cCreateQuery

Methods:


:New(cServer, cUser, cPassword)
Opens connection to a server, returns a server object

:Destroy()
Closes connection to server

:SelectDB(cDBName)
Which data base I will use for subsequent queries

:CreateTable(cTable, aStruct,cPrimaryKey,cUniqueKey,cAuto)
Create new table using the same syntax of dbCreate()

:DeleteTable(cTable)
Delete table

:TableStruct(cTable)
Returns a structure array compatible with clipper's dbStruct() ones

:CreateIndex(cName, cTable, aFNames, lUnique)
Create an index (unique) on field name(s) passed as an array of strings aFNames

:DeleteIndex(cName, cTable)
Delete index cName from cTable

:ListDBs()
Returns an array with list of data bases available

:ListTables()
Returns an array with list of available tables in current database

:Query(cQuery)
Gets a textual query and returns a TMySQLQuery or TMySQLTable object

:NetErr() INLINE ::lError
Returns .T. if something went wrong

:Error()
Returns textual description of last error

:CreateDatabase( cDataBase )
Create an New Mysql Database

:sql_Commit()
Commits transaction

:sql_Rollback()
Rollbacks transaction

:sql_Version()
Server version as numeric