Object LibMyWitch ActiveX Control
This is the main ActiveX object and the starting point to get access to all other objects and interfaces available in this product.
About method
method LibMyWitchOcx.About()
This method shows About box window that provides basic information about the component.
AddSlashes method
method LibMyWitchOcx.AddSlashes(sText)
Quotes a string
Returns a string with backslashes before characters that need to be quoted in database queries etc.
These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).
Authentification property
property LibMyWitchOcx.Authentification As boolean
Use authentification for connecting to restricted web resource
Authentication property determines if LibMyWitch should authenticate with the web server to access protected
resource. In most cases this is not needed, but sometimes access to restricted areas may be
needed.
AuthPassword property
property LibMyWitchOcx.AuthPassword As string
Authentification password for connecting to restricted web resource.
Password property (together with Login property) specifies your credentials to supply to the server
when protected resource need to be accessed. It is used only when Authentication property is set.
AuthUsername property
property LibMyWitchOcx.AuthUserName As string
Authentification username for connecting to restricted web resource
Login property (together with Password property) specifies your credentials to supply to the server
when protected resource need to be accessed. It is used only when Authentication property is set not
set to
AuthNone.
BlowfishEncryption property
property LibMyWitchOcx.BlowfishEncryption As mw_EncryptionEnum
Encypt datatransfere
To protect transfered data, it is possible to encrypt it. It is necessary that the *mCrypt* library
is instaled on the webserver.
To check if these libraries a instaled, you can use the
GetInformation
method
Another way to protect the data is to use SSL encryption by accessing the webserver via 'https://...'
BlowfishPassword property
property LibMyWitchOcx.BlowfishPassword As string
Encrypt data-transfer (via PHP-script)
Encypt data with password (4-54 charcaters).
CloseConnection method
method LibMyWitchOcx.CloseConnection()
Close database connection if opened
ConnectionType property
property LibMyWitchOcx.ConnectionType As mw_ConnectionEnum
Connect to MySQL server via PHP-Script or via MySQL API library 'libmysql.dll'
If the MySQL server is hostet on a webserver behind firewall it is not possile to access the database
directly. In this case a special PHP-script has to be created and uploaded on the webserver.
If the MySQL server is loacted in a LAN it is possible ti access the database directly via the MySQL
API library *libmysql.dll*.
To set the type of connection use this property
CreateMainScript method
method LibMyWitchOcx.CreateMainScript (optional sMySQLServer,optional sMySQLDatabase,optional sMySQLUsername,optional sMySQLPassword,optional lgMySQLPort,optional
bBackTicks,optional bCompressData,optional sBlowfishKey,optional mCryptVersion,optional sSaveToPhpFile)
Create a special PHP script to access MySQL databases on webserver
To access the MySQL database on the webserver, a special PHP script has to be creted and uploaded.
The creation of the script is depending on the configuration of your server and your client.
To check which values should be set to create the PHP-main-script you can call this method once without
any parameters. A PHP-test-script will be created. Upload this and use the GetInformation method
to check the configuration.
Then call the CreateMainScript a second time with the necessary values.
Have also a look at the example
Create PHP-script
.
CreateUPDATEQuery method
method LibMyWitchOcx.Connect (lgRow, lgColumn, sValue, sSql) As LibMyWitchOcx.mw_ErrorEnum
To update the current dataset, create automaticaly an UPDATE SQL query.
Set the row, the column and the value of the dataset which you want to update. If the query is correcly created you get back as an result a function value "mw_Error_NoError"
Execute method
method LibMyWitchOcx.Execute (QueryString, AffectedRows) As LibMyWitchOcx.MyWitch_Recordset
Execute any SQL statements.
GetInformation method
method LibMyWitchOcx.GetInformation (tInformation, sInformation, Optional PHPInfo_Section, Optional
PHPInfo_Field)
Get Informations about configuration.
To configure the PHP-script correctly, which is necessary to access the database, some informations
about the MySQL database and the PHP installation can be called.
If tInformation is set to 'mw_PHP_Info_Information' inforamtions cann be directly called from the PHP-Info
file. This file can be called from the webserver and contains all informations about the PHP
configuration and the installed components. With the additional values of PHPInfo_Section and PHPInfo_Field
the most values can be called from this file.
To see more details have a look at the definition of
mw_InformationEnum
GZipUse property
property LibMyWitchOcx.GZipUse As boolean
Compress data for transfere between client and server
Set this property if you want to compress (gzip) the transfere.
To use this property the free library *zLib.dll* has to be installed on the client and on the server.
To check if these libraries a instaled, you can use the
GetInformation
method
LicenceKey property
property LibMyWitchOcx.LicenceKey As string
Set serialnumber / key
You have to set the registered release code directly within the control property. It don't work,
if you set this code within the source code.
MCryptVersion property
property LibMyWitchOcx.MCryptVersion As mw_mCryptVersionEnum
Set the encryption version on server
If the data transfere should be encrypted it is necessary to get the correct encryption version, which
is installed on the server.
According to the mCrypt version the PHP script have to use different functions.
To check if the version, you can use the
GetInformation
method
MySQLDatabase property
property LibMyWitchOcx.MySQLDatabase As string
Restrict access to MySQL server to a single database
The are two ways to set the database you want to use. With this MySQLDatabase property you restrict
the access to only one database. If you don't set this property you have to set the
SelectDatabase
property
before executing a SQL statement.
(You need this property only, if you access the MySQL database directly via the MySQL API DLL *libmysql.dll*)
MySQLPassword property
property LibMyWitchOcx.MySQLPassword As string
MySQL password of the database server.
(You need this property only, if you access the MySQL database directly via the MySQL API DLL *libmysql.dll*)
MySQLPort property
property LibMyWitchOcx.MySQLPort As string
MySQL Port of the database server.
(You need this property only, if you access the MySQL database directly via the MySQL API DLL *libmysql.dll*)
MySQLServer property
property LibMyWitchOcx.MySQLServer As string
IP or servername of the MySQL server
(You need this property only, if you access the MySQL database directly via the MySQL API DLL *libmysql.dll*)
MySQLUsername property
property LibMyWitchOcx.MySQLUsername As string
MySQL Username to acces the database server.
(You need this property only, if you access the MySQL database directly via the MySQL API DLL *libmysql.dll*)
ProxyPassword property
property LibMyWitchOcx.ProxyPassword As string
Password for remote proxy
ProxyPort property
property LibMyWitchOcx.ProxyPort As long
Port on remote proxy.
When connection to a remote server is requested through a proxy server, this property specifies the
proxy's port number for connection purposes. The usual value for web proxies is 80, or sometimes even
8000, or 8080.
ProxyServer property
property LibMyWitchOcx.ProxyServer As string
Hostname of remote proxy.
When the LibMyWitch control clinet is unable to establish a direct connection (not connected directly
to the internet, for example), the proxy option can be used. When any proxy is used, this property
specifies the hostname for the remote proxy.
ProxyUse property
property LibMyWitchOcx.ProxyUse As boolean
Enable access via proxyserver
ProxyUsername property
property LibMyWitchOcx.ProxyUsername As string
Login/Username for remote proxy.
This property specifies the Login (username) to use when connecting to a remote server through a proxy
server. Since some proxy servers require authorization for access, ProxyLogin and ProxyPassword
properties enable the user to specify his logon name and password on the proxy server.
Recordset property
property LibMyWitchOcx.Recordset As MyWitch_Recordset
Get Recordset (read only).
SelectDatabase property
property LibMyWitchOcx.SelectDatabase As string
Set or Get the current database for this server connection.
The currently selected database, setting this property will cause a "USE Database" on this
database server.
See also
MySQLDatabase property
State property
property LibMyWitchOcx.State As mw_StatesEnum
Current state of LibMyWitch component.
This property may take on many values while executing commands. Depending on this value, the user is
able to monitor the current action that LibMyWitch is performing.
StateString method
method LibMyWitchOcx.StateString(State)
Current state of LibMyWitch component.
This property returns a string expression that tells the current state of the control, or any state
indexed by State argument.
TempPath property
property LibMyWitchOcx.TempPath As string
Temporary folder
If this property is not the set the Windows Temp folder will be used
UrlScript property
property LibMyWitchOcx.UrlScript As string
URL of the PHP-script on your webserver.
If the MySQL database is hosted on a webserver behind a firewall, all database queries will be encapsulated
throuh a PHP-script which will be created by the LibMyWitch Control.
The script has to be uploaded on your webserver.
The URL of the script on the webserver has to be always set.
UseBackticks property
property LibMyWitchOcx.UseBackticks As boolean
Use backticks within SQL statements
A common problem stems from trying to create a table with column names that use the names of datatypes
or functions built into MySQL, such as TIMESTAMP or GROUP.
The way around this is to place backticks (`name`) around the table name and relevant column names,
for example:
CREATE TABLE `group` ( ID CHAR(13) NOT NULL, createdByID CHAR(13) NOT NULL, `read` CHAR(1) NULL, PRIMARY KEY (ID) )
(Only for MySQL Version >3.22.6)
Version
property LibMyWitchOcx.Version As string
Holds version information of LibMyWitch control
This is readonly property where you can find out version number of your instance of LibMyWitch.ocx
VersionScript
property LibMyWitchOcx.VersionScript As string
Holds version information of LibMyWitch PHP-script
This is readonly property where you can find out version number of your instance of the PHP-script -
created with this LibMyWitch Control. Every LibMyWitch control correspond with a special PHP-script. To avoid to get in troube with different versions, the name of the created PHP-script should always
contain this version number.
|