Dear All,
1. How many index on MySql (as index TAG on ADS index .CDX)?
2. How to use it like ORDSETFOCUS()?
3. How to RecordSet()::ReQuery?
Thanks in advance for any help.
Dutch
AHF wrote:Ducth,
Are you using adordd?
SQL CREATE INDEX Statement
The CREATE INDEX statement is used to create indexes in tables.
Indexes allow the database application to find data fast; without reading the whole table.
Indexes
An index can be created in a table to find data more quickly and efficiently.
The users cannot see the indexes, they are just used to speed up searches/queries.
Note: Updating a table with indexes takes more time than updating a table without (because the indexes also need an update). So you should only create indexes on columns (and tables) that will be frequently searched against.
SQL CREATE INDEX Syntax
Creates an index on a table. Duplicate values are allowed:
CREATE INDEX index_name
ON table_name (column_name)
SQL CREATE UNIQUE INDEX Syntax
Creates a unique index on a table. Duplicate values are not allowed:
CREATE UNIQUE INDEX index_name
ON table_name (column_name)
Note: The syntax for creating indexes varies amongst different databases. Therefore: Check the syntax for creating indexes in your database.
CREATE INDEX Example
The SQL statement below creates an index named "PIndex" on the "LastName" column in the "Persons" table:
CREATE INDEX PIndex
ON Persons (LastName)
If you want to create an index on a combination of columns, you can list the column names within the parentheses, separated by commas:
CREATE INDEX PIndex
ON Persons (LastName, FirstName)
cSql := "Select * From [Inventory Location] order by Location"
oRsLoc := TOleAuto():New( "ADODB.Recordset" )
oRsLoc:CursorType := 1 // opendkeyset
oRsLoc:CursorLocation := 3 // local cache
oRsLoc:LockType := 3 // lockoportunistic
TRY
oRsLoc:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening INVENTORY LOCATION table" )
oRsInv:Delete()
oRsInv:CLose()
oRsInv := NIL
oRsInvDetail:CLose()
oRsInvDetail := NIL
oRsEmp:CLose()
RETURN(.F.)
END TRY
// this is used in the inventory table to define location
cLoc := substr("Main"+space(25),1,25)
aLoc := {}
If oRsLoc:eof
oRsEmp:CLose()
oRsInv:Delete()
oRsInv:CLose()
oRsInv := NIL
oRsInvDetail:Close()
oRsLoc:Close()
oRsLoc := NIL
Saying := "Sorry .. there are no Defined Inventory Locations"+chr(10)
Saying += "Please seek your Administrator"+chr(10)
MsgInfo( Saying )
Return(.f.)
Else
oRsLoc:MoveFirst()
Do While .not. oRsLoc:eof
cName := substr(oRsLoc:Fields("Location"):Value,1,25)
AAdd( aLoc, cName )
oRsLoc:MoveNext()
End Do
Endif
oRsLoc:Close()
...
REDEFINE COMBOBOX oLoc var cLoc ID 131 of oWorkB ;
ITEMS aLoc UPDATE
oLoc:lIncSearch = .T.
hb_GetAdoConnection():Execute( CREATE VIEW MYVIEW WITH A RELATION )
SELE 0
USE MYVIEW ALIAS MYVIEW
// OTHER FUNCTION
hb_adoRddGetRecordSet( SELECT( "MYVIEW") ):CLOSE()
hb_adoRddGetRecordSet( SELECT( "MYVIEW") ):OPEN( .... another query
// OTHER FUNCTION
MYVIEW->(DBSEEK( XXX))
// OTHER FUNCTION
oRs := hb_adoRddGetRecordSet( SELECT( "MYVIEW") )
oRs := FW_AdoPivotRS( hb_GetAdoConnection(), "MYVIEW", cRowFld, cColFld, cValFld, cAggrFunc )
SELECT MYVIEW
BROWSE()
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 94 guests