Posts

Showing posts from 2008

How to Add Object button in VFP _Screen Desktop

Image
Public oHandler oHandler = Newobject ("ClickHandler") WITH _SCREEN _SCREEN.Caption='SHOW BUTTON IN VFP DESKTOP SCREEN' .ADDOBJECT("command1","commandbutton") Bindevent (.COMMAND1, "Click", oHandler, "Build") WITH .COMMAND1 .Top = 80 .Left = 10 .Height = 48 .Width = 228 .FontBold = .T. .FontSize = 12 .Caption = "SHOW BUTTON 1" .SpecialEffect = 0 .BackColor = RGB(255,88,9) .Themes = .T. .Name = "Command1" .VISIBLE=.T. ENDWITH .ADDOBJECT("command2","commandbutton") Bindevent (.COMMAND2, "Click", oHandler, "Build1") WITH .COMMAND2 .Top = 150 .Left = 10 .Height = 48 .Width = 228 .FontBold = .T. .FontSize = 12 .Caption = "SHOW BUTTON 2" .SpecialEffect = 0 .BackColor = RGB(255,88,9) .Themes = .T. .Name = "Command2" .VISIBLE=.T. ENDWITH ENDWITH *---------------------------------------- Define Class

How to Recovery MySQL database if you only have Folder Frm, Ibdata1, ib_logfile0, ib_logfile1

Are you have trouble to open database MySQL here i will show you in 4 step : 1. First Backup your database folder make sure you have 3 file and 1 folder frm(database name) or 2 folder or have more folder frm backup all (remember) - ibdata1 - ib_logfile0 - ib_logfile1 - Folder database frm 2. see what trouble you have - Access denied for user 'root'@'localhost'(using password:YES) if you try and try reinstall mysql but security not apply answer: - delete folder mysql in folder data - reinstall mysql - copy all folder frm and 3 file ibdata1,ib_logfile0,ib_logfile1 3. you should try to open database, and if you can open your database enjoy. 4. If you still can't open your database please send me email elchansoft88@gmail.com i will help you as soon as possible

Turn on MySQL query cache to speed up query performance?

As we know, speed is always the most important element in developing a website especially for those high traffic database driven website. You can try to turn on query cache to speed up query. To speed up query, enable the MySQL query cache, before that you need to set few variables in mysql configuration file (usually is my.cnf or my.ini) - 1st, set query_cache_type to 1. (There are 3 possible settings: 0 (disable / off), 1 (enable / on) and 2 (on demand). query_cache_type = 1 - 2nd, set query_cache_size to your expected size. I’d prefer to set it at 20MB. query_cache_size = 20M If you set your query_cache_type = 2 ( on demand ), you would wan to modify your sql query to support cache. SELECT SQL_CACHE field1, field2 FROM table1 WHERE field3 = ‘yes’ To check if your mysql server already enable query cache, simply run this query:- SHOW VARIABLES LIKE ‘%query_cache%’; You will see this result:- +——————-+————————————————————————+ | Variable_name | Value | +——————-+———————————————

How to Create MySQL Store Procedure in Navicat

Example: BEGIN SELECT * FROM CITY WHERE CITY_NME=NAME; END Save Store Procedure with TEST name ***** In Paramter Textbox fill with NAME CHAR(20) click run an entry "BATAM" or what ever CITY name the query should be display with city fill **************** now how to call within VFP **************** Here an example: MYSTS = "CALL TEST('BATAM')" SQLEXEC(1, MYSTS, "MYCURSOR") SELECT MYCURSOR BROWSE

Installing IIS - Cannot find STAXMEM.DL_

Ahhh, IIS, gotta love it. Nothing can ever be easy. So, as I am trying to install IIS on my Dell that I just reformatted, I get this: Cannot find the file STAXMEM.DL_ in my C:\i386 dir. hmm…. well, after a little looking, if you run this command esentutl /p %windir%\security\database\secedit.sdb If you then retry the install, it should work

Fix Generic Host For Win32 and Svchost.exe Error

Now we no longer have to worry about “Generic Host for Win32 Process” and “svchost.exe” errors that haunt our Windows XP almost daily (If not cured). Below i will explain what are the symptoms of this evil problem and how easily it can be fixed: Symptoms: You are surfing the internet or are engaged any type of Internet activity when suddenly all your Network activity goes to hault. You can still see the Internet connected icon in the tray but you cannot surf, browse or do anything. You get an error message something like “Generic Host Process for Win32 Services has encountered a problem and needs to close. We are sorry for the inconvenience.” Error message reporting about faulting netapi32.dll and svchost.exe. You try to disconnect your Internet because of no activity observed but the Internet icon wont disappear. You recieve an error message something like “Your PC has recovered from a serious problem” etc. Solution: Follow these simple steps and your Windows will be fully cured of t

How to Change MySQL Default Data Folder to another Folder

Today a client wanted to move his MySQL database to second hard disk. Moving MySQL database to its own hard disk improve IO performance as the hard disk only need to serve MySQL data, nothing OS related. This was a cpanel server, so start with stoping chkservd, so mysql or httpd will not start while i copy the files. First created a copy of MySQL database on second hard disk, which is mounted as /backup rsync -vrplogDtH /var/lib/mysql /backup/ Now stop chkservd, mysql and apache service chkservd stop service mysql stop service httpd stop Wait few minutes and run rsync again to update the database rsync -vrplogDtH /var/lib/mysql /backup/ We have now MySQL database copied to /backup/mysql folder. Rename orginal MySQL data files with mv /var/lib/mysql /var/lib/mysql_old Now edit /etc/my.cnf vi /etc/my.cnf You need to add following line datadir = /backup/mysql To start of the file. If datadir already set, you need to change path. Everything is finished, just restart mysql, apache and check

(VFP) - Amazing VFP Studio Code Editor in Visual Studio 2008

Since posting the countdown, I've been fielding lots of questions regarding VFP Studio. Some of the mystery surrounding VFP Studio has been on purpose and some of it has been because we (Bo Durban and I) are not yet sure what all is possible working within the framework provided by Microsoft via the Visual Studio Isolated Shell. However, in order to provide a little more transparency and begin the process of getting feedback from the community I will be presenting a series of screencasts in the next few months. Here I present the first screencast in the series on VFP Studio's Code Editor. VFP Studio's Code Editor, which is made possible via a Language Service Bo Durban and I created in Visual Studio 2008, provides some significant enhancements when compared to the editor included in VFP 9.0 including outlining, Quick Info, Intellisense for user-defined classes, line numbers, word wrap, VS-style navigation bar, improved Code Snippets and various other features we are impleme

XP - The Sharing tab is not visible. (Gone From Tab Menu)

Use the Services snap-in to start the Server service. To do this, follow these steps: 1.Click Start, and then click Control Panel. 2.Click Performance and Maintenance, click Administrative Tools, expand Services and Applications, and then double-click Services. 3.Right-click the Server service, and then click Start. 4.Restart Computer •The folder is already shared. Click New Share, and then type the new share name. •You want to hide the shared folder. To hide the shared folder, type $ as the last character of the share name. Other users cannot see this shared folder when they search by using My Computer or Windows Explorer, but they can map to the shared folder.

Status XP "Cannot find \\computername or \\computername is not accessible"

Solutions Click Start - Run - services.msc Search Workstation double click Workstation change Automatic process and apply them restart computer and you done...

Status XP "acquiring network address"

dude.... acquiring network address is basicaly translated to an ip address 0.0.0.0, if a winxp does not have the sp2 it will just say invalid ip and the ip is 0.0.0.0 here is the procedure to correct this click on start, run, services.msc look for DHCP client.... if it sess acquiring network address that means that the dhcp client is DISABLED OR STOPTED... highlight the DHCP client and on the left side you will see "START" the service, click on it and then it will say "STOP, RESTART" then double click on the service and on the startup type select automatic, apply by the way.. also chk the tcp/ip properties, make sure that we have all to automatic

How to Handle - Error Access Denied for Sql server

When to create ODBC connection using sql server appear access denied (08001) In Client: Step I Name : 'xxx' Description : 'xxxxxxxxxx' server : 'mynameserver' Step II Click With SQL Server authentication Click Connect to SQL Server Fill Login ID : Fill Password : Step III - Click Client Configuration Button - Choose TCP/IP - Remove or Uncheck choice in Dynamically determice port Follow next step and Finish Test Connection (Is must Success)

How to Change MSDE 'sa' password

Change your MSSQL Server or MSDE password for 'sa' login C:\osql -U sa 1>sp_password NULL,'new_password','sa' 2>go 3>quit

Configuring SQL Server authentication for MSDE and MS SQL Server

By default, when you install MSDE it is configured to support Windows authentication only. Windows authentication is usually not appropriate for web applications such as Enterprise Server, so you will have to override the default installation settings. Additionally, the setup program for MSDE has a bug, so even if you run the MSDE setup program with the parameter SECURITYMODE=SQL it will ignore this parameter and leave the security mode set to Windows Authentication only. As such, once you have installed MSDE, you will have to manually change the security mode for the MSDE Server by making some changes to the windows registry. The following is a brief description of this process. For further information, refer to http://support.microsoft.com/kb/Q322336/EN-US/ I. Manually changing the authentication settings for SQL Server 2005 and SQL Server 2005 Express servers You can change the Authentication mode on existing MSDE Servers by modifying a value in the windows registry, as follows: 1

(VFP) - How To Calling Store Procedure From VFP

USING SQL SERVER: ======================= MYSTS = "EXECUTE MYQUE" SQLEXEC(1, MYSTS, "MYCURSOR") USING MYSQL: ================= MYSTS = "CALL MYQUE();" SQLEXEC(1, MYSTS, "MYCURSOR")

(VFP) - Include Beautiful Clock on your Form

PUBLIC omform1 SET CLASSLIB TO c:\VCLOCK\class\mform.vcx ADDITIVE SET CLASSLIB TO c:\VCLOCK\klock.vcx ADDITIVE omform1=NEWOBJECT("mform1") omform1.Show RETURN ******************************************************** *-- Author: Leosan *-- Form: mform1 (c:\VCLOCK\form\clock.scx) *-- ParentClass: mform (c:\VCLOCK\class\mform.vcx) *-- BaseClass: form *-- Time Stamp: 01/30/08 10:16:06 AM * DEFINE CLASS mform1 AS mform Height = 177 Width = 181 ShowWindow = 0 DoCreate = .T. Caption = "Clock" MaxButton = .F. MinButton = .F. Name = "Mform1" ADD OBJECT clock1 AS clock WITH ; Top = 5, ; Left = 9, ; Width = 168, ; Height = 168, ; ZOrderSet = 1, ; Name = "Clock1", ; year.Name = "year", ; Transring1.Height = 160, ; Transring1.Width = 160, ; Transring1.Name = "Transring1", ; Timer1.Name = "Timer1", ; dayname.Name = "dayname", ; month.Name = "month", ; day

(VFP) - How to Get Week on Current Month

***************************************************** ** Show you how to Get Week count on Current Month ** ***************************************************** INT((DAY(GOMONTH(DATE(),1)-DAY(GOMONTH(DATE(),0))))/7)

(VFP) - Display Fade in Form How to Do it ?

****************************************** ** Examples How to Display Fade In Form ** ****************************************** _screen.WindowState = 2 LOCAL frmFadeIn as Form frmFadeIn = CREATEOBJECT("myFadeInForm") frmFadeIn.Show READ EVENTS DEFINE CLASS myFadeInForm as Form AutoCenter = .T. Caption = "Fade-In Form" ShowWindow = 2 nDepth = 0 ADD OBJECT fadeTime as timer WITH ; interval = 10,; enabled = .T. PROCEDURE Init DECLARE INTEGER SetWindowLong IN user32.DLL INTEGER hWnd, ; INTEGER nIndex, ; INTEGER dwNewLong DECLARE INTEGER SetLayeredWindowAttributes IN WIN32API INTEGER HWND, ; INTEGER crKey, ; INTEGER bAlpha,; INTEGER dwFlags #DEFINE LWA_TRANSPARENT 1 #DEFINE LWA_ALPHA 2 #DEFINE GWL_EXSTYLE -20 #DEFINE WS_EX_LAYERED 0x00080000 SetWindowLong(thisform.HWND, GWL_EXSTYLE, WS_EX_LAYERED) SetLayeredWindowAttributes(thisform.HWND, 0, thisform.nDepth, LWA_ALPHA) ENDPROC PROCEDURE unload CLEAR DLLS CLOSE ALL RELEASE ALL QUIT ENDPROC PROCEDURE fadeTime.timer IF thi

(VFP) - How To Run Exe File and include them to your Project

******************************* ** Author : Leosan ** ** Date Publish : 29/01/2005 ** ******************************* * Examples how to run Windows Calculator * declare long ShellExecute in "shell32.dll" long hwnd, string lpszOp,string lpszFile, string lpszParams,string lpszDir, long nShowCmd declare long GetDesktopWindow in"win32api" local hDCScreen hDCScreen = GetDesktopWindow() ShellExecute( hDCScreen, "open", "calc.exe", "", "d:\", 1)

(VFP) - Change Resolution on your Screen

Function ChangeRes && Author: Alexandre Hédréville && Cambia la resolución de la pantalla && Sintaxis: ChangeRes(tnWidth, tnHeight) && Valor devuelto: llRetVal && Argumentos: tnWidth, tnHeight && tnWidth especifica la nueva anchura de la pantalla en pixels && tnHeight especifica la nueva altura de la pantalla en pixels LPARAMETERS tnWidth, tnHeight LOCAL lnWidth, lnHeight, lnModeNum, lcDevMode && Valores lnModeNum = 0 lcDevMode = REPLICATE(CHR(0), 156) lnWidth = IIF(EMPTY(tnWidth), 800, tnWidth) lnHeight = IIF(EMPTY(tnHeight), 600, tnHeight) && Instrucciones DECLARE DLL para cambiar resolución DECLARE INTEGER EnumDisplaySettings IN Win32API ; STRING lpszDeviceName,; INTEGER iModeNum, ; STRING @lpDevMode DECLARE INTEGER ChangeDisplaySettings IN Win32API STRING @lpDevMode, INTEGER dwFlags && Bucle para obtener todos los modos di

(VFP) - How to insert simple Progress Bar

************************************************** ** The following shows Records for progress bar ** ************************************************** ** Create By : Leosan ** ** Date Create : 22-12-2004 Time 08.00 am ** ** Class Name : ProgressingBar ** ** Form : ProgressingBar ** ** ParentClass : form ** ** BaseClass : form ** ** Time Stamp : 22/12/2004 08:09:04 AM ** ************************************************** DEFINE CLASS ProgressingBar AS form Height = 70 Width = 408 AutoCenter = .T. BackColor = RGB(240,240,240) BorderStyle = 3 Caption = "" Closable = .F. ControlBox = .F. MaxButton = .F. MinButton = .F. Movable = .F. AlwaysOnTop = .f. ShowWindow = 1 Name = "ProgressBar" ADD OBJECT shape1 AS shape WITH ; Curvature = 10, ; Top = 6, ; Left

(VFP) - Utility to Rebuild CDX File...

********************************************************** ** Utility to ReBuild CDX index files. ********************************************************** ** Author : Ramani (Subramanian.G) ** FoxAcc Software / Winners Software ** Type : Freeware with reservation to Copyrights ** Warranty : Nothing implied or explicit ** Last modified : 19 November, 2004 ********************************************************** ** Function to rebuild CDX index ... this does.... ** First deletes the index and then recreates them ** How to ... ** Save this file as BuildIndex.PRG ** or add to your library as BuildIndex ** =BuildIndex(myDBF) ********************************************************* ** FUNCTION BuildIndex PARAMETERS myDBF IF PARAMETERS() # 1 RETURN .F. ENDIF LOCAL laIndex, cKey, cIndex USE (myDBF) DIMENSION laIndex(254,3) ** Load the index name and key names in array FOR nCount = 1 TO 254 IF !EMPTY(TAG(nCount)) && Checks for tags in the index

(VFP) - Search Char in Word

vword = 'MICROSOFT#VISUAL#FOXPRO#SEDNA_SP2' v1 = GETWORDNUM(vword,1,'#') v2 = GETWORDNUM(vword,2,'#') v3 = GETWORDNUM(vword,3,'#') v4 = GETWORDNUM(vword,4,'#')

(RPG) - RPG/400 Tutorial

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/sc09-1817-00.html

(General) - Connection String For Programming

http://www.connectionstrings.com/

(VFP) - A sample seach form

********************************************************* ** Author : Ramani (Subramanian.G) ** FoxAcc Software / Winners Software ** ramani_vfp@yahoo.com ** Type : Freeware with reservation to Copyrights ** Warranty : Nothing implied or explicit ********************************************************* ** How to Run.. ** 1. Save the following code as gsSearch.PRG ** 2. From the command window run that ** DO gsSearch ********************************************************* ** gsSearch.prg ********************************************************* CREATE CURSOR test (cName C(20), email c(20)) INSERT INTO test (cName, email) VALUES ("experts","experts@Tek_tips.moc") INSERT INTO test (cName, email) VALUES ("Dummy","dummy@dummy.moc") INSERT INTO test (cName, email) VALUES ("ClayHead","clay@dummy.moc") INSERT INTO test (cName, email) VALUES ("WoodBrain","wood@dummy.moc") INSERT INT

(VFP) - How to extract duplicate records from a table ?

How to extract duplicate records from a table ? By duplicate, I do not mean the replica of one record in another. For example, a sigle field such as Account_Id field may be existing twice or more number of times in a table, while the rest of the records content could be different. Or simply two fields concatenated may exist more than once in the same table. We can quickly obtain a list of such field values (let us call it duplicated records) with the code.... SELECT account_id FROM customer GROUP BY account_id ; HAVING COUNT(account_id) > 1 OR SELECT first_name + last_name AS cust_name ; FROM customer GROUP BY first_name + last_name ; HAVING COUNT(first_name + last_name) > 1 The above only picks up the field values which has duplicate records, while all the duplicated records are not listed. With the following code, we can get the full list of duplicated records. SELECT * FROM customer WHERE account_id IN ; (SELECT account_id FROM customer GROUP BY account_id ;

(VFP) - Running Visual FoxPro on Linux

Running Visual FoxPro on Linux By Paul McNett (FoxTalk, March 2003) While Microsoft publicly refuses to release Visual FoxPro for alternate platforms, there's still hope for a multi-platform VFP. Using an open-source product called Wine, Paul McNett shows how we can take matters into our own hands and put the fox on Linux ourselves. Remember last century, when one of FoxPro's greatest selling points was its ability to run and deploy to not one, not two, not three, but four separate platforms? This was a powerful selling point for me when I was choosing my development environment: Even though I only ever deployed to Windows, it was reassuring to know I wouldn't be painted into a corner should a client ask about a Mac, Unix, or DOS version of my software. Contrast that to today: As new versions of Visual FoxPro emerge with their great features and fixes, I keep finding myself thinking that our situation as VFP developers is pretty dire, being limited to developing and deployi

(VFP) - How to make menu appear in my form

1. Open the menu (modify menu), the menu gets opened with the wizard... then ... Choose from the system menu..View..GeneralOptions. Select Top-Level Form... Click OK 2. Again from the system menu ... choose ... Menu... Generate... Generate This will generate the menu mpr file 3. Now open the main form. Set in the properties, ShowWindow = 2 && As top level form In the InitEvent of the form.. put the code DO myMenu.MPR WITH THIS 4. Compile and run

(VFP) - How to put calendar on your vfp application

DEFINE CLASS form1 AS form Height = 239 Width = 286 ShowWindow = 1 DoCreate = .T. AutoCenter = .T. Caption = "Calendar" MaxButton = .F. MinButton = .F. Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; AutoSize = .F., ; Top = 204, ; Left = 82, ; Height = 27, ; Width = 55, ; Caption = "\ Name = "Command1" ADD OBJECT olecontrol1 AS olecontrol WITH ; Top = 0, ; Left = -1, ; Height = 200, ; Width = 289, ; Name = "Olecontrol1" ADD OBJECT command2 AS commandbutton WITH ; AutoSize = .F., ; Top = 204, ; Left = 149, ; Height = 27, ; Width = 54, ; Caption = "\ Name = "Command2" PROCEDURE Init SET DATE BRITISH PUBLIC OCAL AS DATE THISFORM.OleControl1.OBJECT.DAY = DAY(DATETIME()) THISFORM.OleControl1.OBJECT.MONTH = MONTH(DATETIME()) THISFORM.OleControl1.OBJECT.YEAR = YEAR(DATETIME()) ENDPROC PROCEDURE command1.Click OCAL = SUBSTR(DTOC(THISFORM.OLEcontrol1.OBJECT.Va

(VFP) - How to Pack data automaticaly

This code show u how to do it ****************** PARAMETERS myDataDir SET EXCLUSIVE ON LOCAL aFiles, nCount, I DIMENSION aFiles(1,1) nCount = ADIR(aFiles,mydataDir+"\"+"*.DBF") =ASORT(aFiles,1) I=1 FOR I = 1 TO nCount WAIT WINDOW "Reindexing "+aFiles(I,1)+ ; " ... Please wait" NOWAIT SELECT 0 USE mydataDir+"\"+(aFiles(I,1)) PACK USE WAIT CLEAR ENDFOR SET EXCLUSIVE OFF RETURN

(VFP) - How to include splash screen..

You can use this generic routine for display your splash screen Put code in main program ********* HIDE WINDOW SCREEN DO FORM SPLASH =INKEY(3,[H]) *** display 3 second appear on your screen SHOW WINDOW SCREEN

Welcome to my share about computer and VFP

The main purpose of starting this page is to share my Visual FoxPro related interests. As time proceeds, I will decide what more I can add in here. It all depends on the encouragement and success by way of feedbacks and comments of browsing members. There will be frequent changes as I keep building this site. Please bookmark this site and visit as often as you like. When you copy what you find from this site and provide the same to some one else or quote a piece of code somewhere, please make sure to tell where you found it and make a reference to this site. Probably they can derive greater benefits from visiting this site. If you feel that this site has benefited you considerably, tell a prayer for the benefit of my dependents and me at your next prayer time.