Wiki Home

VFP Web Tools


Namespace: WIN_COM_API
Please describe VFP Web Tools here.

We recently develop a Microsoft Visual FoxPro web system compatible in Internet Explorer environment, which does not require to change the original style of development and the development of language, and can use Microsoft Visual FoxPro to develop B / s system, the system can use VFP report and VFP all function directly.
Adopting three layers structure of the system, the database uses Microsoft sqlserver, data processing support synchronization of asynchronous processing, to enhance the processing ability of the VFP data, the system also provides the new function for the call, these functions can realize function of front and back arbitrarily and flexibly use the data.
The following is a simple DEMO, used to show the development of our methods and operating results:

Program entry development interface::

Program running interface:



Interface design of data query, data query using asynchronous processing technology, server-side processing good data and encryption and compression by IIS are sent to the front desk and then decrypted restore cursor or table, is displayed in the grid, tens of thousands of pieces of data in a matter of seconds processing is complete.

Program running interface:



3、New function
3.1、The database function (can only be used for background script operation)

Function name: SQL_SW (tcCmd, tnSQLCA)
Parameter Description: tcCmd range (start, commit, rollback)
Function Description: call SQL transaction
The function of the sample: SQL_SW ("start")

Function name: SQL_CREATE (tcTable, tnSQLCA)
Parameter Description: tcTable create table name
Function Description: to create a table in the current workspace to the SQL database
Function example: C:\Table1.dbf Use
SQL_CREATE ((ALIAS))


Function name: SQL_SAVE (tcWebTable, tcFieldList, tcRecnList, tcsavestate, tcDbKey, tnSQLCA)
Parameter Description: tcWebTable table name
The list of fields to save tcFieldList
TcRecnList to save the recording range
SQL tcDbKey table of the primary key, the default is ID_PRIKEY
Write back data sheet
Function example: SQL_SAVE ()
Save the table
SQL_SAVE (ALIAS), ("NAME, SEX", "SEX=" male ")
Just save for the male sex and only save the NAME and SEX columns


Function name: SQL_USE (tcSqlDb, tcField, tcFilt, tcAlianame, tnSQLCA,)
Parameter Description: tcSqlDb to open the table name
TcField to read the column
TcFilt to read the record range
TcAlianame open table alias
Function Description: open data table
Function example: SQL_USE ("TABLE")
Open SQL table "TABLE""
SQL_USE ("TABLE", "NAME, SEX", "SEX=" male "", "TABLE2")
Only open the SQL table "TABLE" in the SEX for the male NAME and SEX, and this table alias TABLE2

Function name: SQL_ERROR ()
Parameter description:
Function Description: return SQL error message
Function example:

Function name: SQL_CHANGECOLUMN (tcAlter, tcDbnm, tcField, tcFieldType, tcFieldLen, tcFieldDec,)
Parameter Description: tcAlter value range (add, modify, rename, delete)
TcDbnm table name
TcField field name
TcFieldType field type
TcFieldLen field length
TcFieldDec field decimal
Function Description: modify the data structure of SQL table
Function example: SQL_CHANGECOLUMN ("add", "TABLE", "AGE", "N", "", 3)
In the "TABLE" in the new AGE column, the column data type is N, length is 3, no decimal point


Function name: SQL_AUTOID (tcXhID, tnXhStep)
Parameter Description: tcXhID serial number identification
TnXhStep serial number step value
Function Description: ID returns only a serial number identification
The function of the sample: SQL_AUTOID ("TABLE")
Return to TABLE as the only ID logo


Function name: SQL_LOCK (tcTable)
Parameter Description: tcTable table name
Function Description: lock SQL data table, prevent multiple people at the same time to operate this table
Function example: SQL_LOCK ("Table")


Function name: SQL_UNLOCK (tcTable)
TcTable table name
Unlock lock SQL data sheet
Function example: SQL_UNLOCK ("Table")


Function name: SQLEXEC_ (tcTable, tcSQLCmd, tcAlias)
TcTable table name
SQL tcSQLCmd command
TcAlias table alias
Function Description: execute SQL command
Function example: SQLEXEC_ ("TABLE", "SELECT * TABLE FROM", "TABLE2")

System general function (foreground background can be used)

Function name: DELETREE_ (tcPath)
Parameter Description: tcPath disk directory
Function Description: delete the specified directory of all files, including the sub directory
Function example: DELETREE_ ("C:\TESTSOFT")


Function name: TEMP_ (tcFileName)
Parameter Description: tcFileName file name
Function Description: return to the system temporary directory or temporary directory under the file name
Function: TEMP_ (example)
Returns the system temporary directory
TEMP_ ("ABC.DB")
Returns the full file name of the ABC.DB in the temporary directory of the system


Function name: MKDIR_ (tcPath)
Parameter Description: tcPath disk directory
Function Description: create a specified directory to prevent the specified directory does not exist
Function example: MKDIR_ ("C:\TESTSOFT\ABC")


Function name: MCursorToStr_ (tcCursorList)
Parameter Description: tcCursorList with the cursor separated list;
Function Description: compression multiple cursor file into a string
The function of the sample: MCursorToStr_ (TABLE1; TABLE2; TABLE3)


Function name: MStrToCursor_ (tcString)
Parameter Description: tcString cursor into the compressed string
Function Description: will be compressed into a string to restore the file
Function example: MStrToCursor_ ("STRING")


Function name: Table2Grid_ (tcTable, tcTable0, toGrid, tlNoFormat)
TcTable table name
TcTable0 zero table name
ToGrid form control
TlNoFormat does not use system style
Function Description: the table will be formatted into the form control system
Function example: Table2Grid_ ("TABLE", THISFORM.GRID1)
Format table GRID1 in the form of TABLE in the form.
Table2Grid_ ("TABLE", "TABLE0", THISFORM.GRID1)
Format table GRID1 in the form of the system style to the form TABLE, and by the style of the zero table display field names, etc.
Table2Grid_ ("TABLE", "TABLE0", THISFORM.GRID1,.T.)
Format table GRID1 to TABLE in the form in the form of the system style, do not change the style of the original table


Function name: Grid2Excel_ (loGrid, lcExcel, lcExt, loADGrid)
LoGrid form control
EXCEL lcExcel file name
The lcExt file format, the range (XLS, DBF, txt)
LoADGrid multi meter control
Function Description: export data in the control table for the EXCEL file
The function of the sample: Grid2Excel_ (THISFORM.GRID1, C:\EXCEL.XLS)
The form form of control data to an C:\EXCEL.XLS file



Function name: RunFile (tcFileName)
Parameter Description: tcFileName file name
Function Description: open the specified file
Function example: RunFile ("C:\TESTSOFT.TXT")


Function name: StatusInfo (tcInfo, tnSite)
Parameter Description: tcInfo display information
TnSite shows the location of the range (-3, 1, 2, 3, 4, 5), the default is 4
Function Description: information is displayed in the status bar on the platform
Function example: StatusInfo ("welcome to use Test software platform")


Function name: DOAJAX (tcFSName, tcSendStr, tcRcvFunc, Thisform, tcSysName)
Parameter Description: tcFSName call FS file server
TcSendStr POST series
TcRcvFunc callback function name
Thisform callback object, using the default Thisform value
TcSysName subsystem name, default current subsystem
Function Description: command interaction with the server, call the system on the script that returns the data needed
The function of the sample: DOAJAX ("SYS.FS", "NAME=" XXX "," THISFORM.GETFS "(), THISFORM)


Function name: WEBURL (tcUrl, tcRcvProg, tlSyn)
Parameter Description: URL tcUrl address
TcRcvProg callback function
TlSyn synchronous execution
Function Description: call an URL address, or form
Function example: WEBURL ("TEST.SCX")
Function name: MSG_ (tcTitle, tcPic, tcMsg, tcButt, tnDefaultButt, tnDefaultTime,)
Parameter Description: tcTitle message box title
TcPic message box picture, value range (XI)
TcMsg message box message
TcButt message box button type, range (O, OC, ARI, YNC, YN, RC)
TnDefaultButt default button, value range (1, 2, 3)
TnDefaultTime timeout, the default does not time out
Function Description: call MESSAGEBOX dialog box
Function example: MSG_ ("HELLO", "I", "WORLD HELLO", "OC", "", 2)


Function name: RESIZEIMAGE (tcResImage, tcObjImage, tcWidth, tcHeight)
Parameter Description: tcResImage original picture
TcObjImage new picture
TcWidth width
TcHeight height
Function Description: specify the size of the image to the specified size.
Function example: RESIZEIMAGE ("C:\A.JPG", "C:\B.JPG", 100100)


Function name: _FROMRUN (tnFormHwnd, tcFunc)
Parameter Description: tnFormHwnd call to the form of the handle
Function or method of tcFunc call
Function or method to call other forms.
Function example: _FROMRUN (12345, "RESIZE")


Function name: WEBSELE (tcWebTable, tcFieldList, tcRecnList, tcrcvfunc)
TcWebTable table name
TcFieldList field list
TcRecnList range conditions
Tcrcvfunc callback function
Function Description: in front of the page to open a table in the background database
Function example: WEBSELE ("TABLE")


Function name: WEBSAVE (tcWebTable, tcrcvfunc, tcFieldList, tcRecnList, tcDbKey)
Parameter Description: tcWebTable table name
Tcrcvfunc callback function
TcFieldList field list
TcRecnList range conditions
SQL tcDbKey library primary key
Function Description: a table stored in the backstage database of the front page
The function of the sample: WEBSAVE ("TABLE")

Function name: PRINT_ (tcPrintName, tcPrintXmlSetting)
Parameter Description: tcPrintName print or report name
TcPrintXmlSetting statements related to the XML parameters
Function Description: call the print window
The function of the sample: PRINT_ ("REPONAME")
( Topic last updated: 2016.04.23 01:55:48 PM )