PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: Creating a view
  • Example: Creating a view with a condition on a Numeric variable
  • Example: Creating a view with a condition on a Character String variable
  • Example: Performing a search on a composite key found in a view
HCreateView (Example)
Example: Creating a view
The following example is used to create a view and to read the records found in the view. These records are displayed in a trace window.
View1 is Data Source
// Create the view
IF HCreateView(View1, Category, "*", "", "Caption>='B'", hViewAdd) = False THEN
Error(HErrorInfo())
END
// Browse the view
HReadFirst(View1)
WHILE NOT HOut()
// Read the caption item of View1
Trace(View1.Caption)
HReadNext(View1)
END
HDeleteView(View1)
Example: Creating a view with a condition on a Numeric variable
The following example is used to create a view with a condition on a Numeric variable.
EXTERN MyView
// Create the view
IF HCreateView("MyView", FileName, "*", "", ...
"ItemName =" + VariableName, hViewDefault) = False THEN
  Error(HErrorInfo())
END
// Browse the view
HReadFirst(MyView)
WHILE NOT HOut()
  // Process to insert
    HReadNext(MyView)
END
Example: Creating a view with a condition on a Character String variable
User code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses) The following example is used to create a view with a condition on a Character String variable.
EXTERN MyView
// Create the view
IF NOT HCreateView("MyView", FileName, "*", "", ...
"ItemName =" + VariableName + "", hViewDefault)  THEN
Error(HErrorInfo())
END

// Browse the view
HReadFirst(MyView)
WHILE NOT HOut()
    // Process to insert
    HReadNext(MyView)
END
Example: Performing a search on a composite key found in a view
WINDEVUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses) The following example is used to create a view and to perform a search on a composite key found in the view.
// Create the view
MyView is Data Source
HourGlass()
HCreateView(MyView, Cedex, "*", "", "", hViewDefault)
// Search
HReadSeekFirst(MyView, "CityZipCode", ...
HBuildKeyValue(Cedex, CityZipCode, "75000", "PARIS"))
HourGlass(False)
IF HFound() = True THEN
    Info("Record found")
    Trace(MyView.city + " " + MyView.ZipCode)
ELSE
    Info("Record not found")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment