FoxPro

Visual FoxPro (VFP), and its predecessor FoxPro, is a data-centric, object-oriented, procedural, database programming language and IDE from Microsoft last released in 2007 that still has some active use due to its low cost of deployment and fairly rapid development. In 2008, Microsoft released a set of add-ons for VFP's xBase components to allow interoperability with various Microsoft technologies. It allows data processing against its native file-based data tables or database servers such as SQL Server.

Share tech news, updates, or what's on your mind.

Sign up to Post

i have sql table with field named arabdes with type nvarchar (100) and with arabic letter entries, i'm trying to retrieve via visual foxpro, but i keep getting ????? instead of the data itself, and the field type on my query is only character and not varchar, can anyone help me with to correctly retrieve this information correctly, thanks in advance
0
JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Hi Experts

Could you point a way to prevent .FRX and .FRT files corruption?

Accordingly with
It looks to be corrupted:
img001
and then, replacing with the FRX and FRT backups
img002
Thanks in advance!
0
Hi Experts

Could you point out a routine to track the delay of the program steps during a VFP operation?

A client is complaining about the delay when saving data to .DBF (s) files. The problem is intermittent, not always occurs, just at the moment the customer push the "Save" button.

I guess Network latency is probably causing this. If so, how to workaround?

Thanks in advance.
0
In a vfp form, how do I get
      ? "Hello"
to write to the screen instead of the form?

I have tried set talk off and set console off on the form load and data environment init procedures.
0
We need to send emails from our VFP app. Currently we are calling outlook directly to do so using the following code. Ideally it would not depend on any external application and submit an email directly to a configured smtp server. If that is not an option using a generic interface that does not directly depend on outlook would still be useful. We do not need to receive email on these workstations, the mailing function should be as transparent to the user as possible, and not depend on outlook.   It will need to run on Windows Server 2012.

lnArea=SELECT()

lcBody = 'REQUEST DESCRIPTION: '+ALLTRIM(vSQLITRequests.Description)+CHR(13)+CHR(10)+CHR(13)+CHR(10)+;
			IIF(EMPTY(vSQLITRequests.Details),'','DETAILS: '+ALLTRIM(vSQLITRequests.Details)+CHR(13)+CHR(10)+CHR(13)+CHR(10))+;
			'CREATED AT: '+TTOC(vSQLITRequests.dtCreated)+CHR(13)+CHR(10)+;
			'CREATED BY: '+ALLTRIM(vSQLITRequests.CreatedBy)+CHR(13)+CHR(10)+;
			IIF(EMPTY(vSQLITRequests.ModifiedBy),'','MODIFIED AT: '+TTOC(vSQLITRequests.dtModified)+CHR(13)+CHR(10)+;
			'MODIFIED BY: '+ALLTRIM(vSQLITRequests.ModifiedBy)+CHR(13)+CHR(10))+;
			'REQUESTING EMPLOYEE: '+ALLTRIM(vSQLITRequests.RequestedBy)+CHR(13)+CHR(10)+;
			'REQUESTED COMPLETION ON OR BY DATE: '+DTOC(vSQLITRequests.dtRequestedComp)+CHR(13)+CHR(10)+;
			'PRIORITY: '+ALLTRIM(vSQLITRequests.Priority)+CHR(13)+CHR(10)+;
			'STATUS: '+ALLTRIM(vSQLITRequests.Status)+CHR(13)+CHR(10)+CHR(13)+CHR(10)+CHR(13)+CHR(10)
			
			

Open in new window

0
Hi Experts

Could you point how to workaround this mscomctl.ocx instalation on Win7?

A customer laptop using Win7 64 bits couldn't install mscomctl.ocx  with administrator privileges:

C:\Windows\SysWOW64\REGSRV32 mscomctl.ocx

Since this error occurs:
 img001
That means: maybe the module "mscomctl.ocx" doesn't be compatible with the Windows version you are using.
Check if it is compatible with one version x86(32 bits) or x64(64bits) from file regsrv32.exe

I had obtained the mscomctl.ocx from my own Win10 laptop and send it to the customer, maybe it's caused (or not) the bug.

Amazingly when running Dependency walker on my own PC, where it's correctly running,   the report is very extense... so I'm avoiding to ask the customer to do that, added the fact he will have some dificulties on this operation. I'm planning to send him a mscomctl.ocx that runs at a Win7 64bits - for another try...

Do you know any workaround on this problem, like known .DLL(s) that must exist in conjunction?

Thanks in advance!
0
I am sending parameters to a program based on user entry/selection on a form.

The variables entered in the form may look like this:

      lnWeekNum = "52"
      lcProd = "P"
      lcDate = "02/22/19"

The variable names are in a field called varpass and correspond to the variables on the form:
      varpass field = lnWeekNum, lcProd, lcDate
 

I have this working (thanks pcelba!) with this code:

SELECT varpass  FROM prodprocs WHERE procname = lcProgram INTO ARRAY laParms
*(laParms = lnWeekNum, lcProd, lcDate)
if empty(sys(2000,lcFilePath)) then
       lcMsg = lcFilePath + " does not exist *"
      Messagebox (lcMsg)
      return
 endif

IF !EMPTY(laParms[1])
  lcParams = ALLTRIM(laParms[1])
  do &lcFilePath with &lcParams

ENDIF

I need to be able to convert the variable type from a string to the data type that the called program requires.
I have added a field to the table called vartype to the table.

vartype values looks like this:
      vartype = val, str, dtoc

I think I need to add another dimension/field (varrtype) to the array containing the data type for each value in varpass.

I have added vartype to the select statement, but I haven't been able to take it any further.

SELECT varpass, vartype  FROM prodprocs WHERE procname = lcProgram INTO ARRAY laParms

I need to do these conversions based on this example:
      lnWeekNum = num(lnWeekNum)
      lcProd = str(lcProd)  .. no change
      lcDate = dtoc(lcDate)
0
Hi Experts

Could you point out the best way to install oleTreeView and oleImageList on a new laptop that uses VFP?

A form that uses these controls does not work on the new laptop, I think due to the inexistence of them.

(The same form runs perfectly on a desktop).

Thanks in advance!
0
I am getting “File does not exist” when they definitely do exist.  I have tested this endlessly.
I am testing an app that has a list of Foxpro programs in a list box.  The user selects a a program and clicks the “Run” button.
All the test programs in the list are in the same directory.  It works(ed) for one program and not the others.
To verify the validity of the path and filename:
1)      I duplicated the file names (and path) in the list that won't work, with the same file name as the one does works.  Copy and pasted.  I still get "File does not exist".  I pasted back it back over to this same one that was working – it no longer works.

     2) Programmitically wrote the location and filename to a text box before the program tries to run it.  After getting "File Does Not Exist", I  copied and pasted the text box contents into file explorer.  It opens, every time.

   3) I removed the following from my code that I thought was triggering the "file does not exist" error:
            if empty(sys(2000,lcFilePath)) then
                lcMsg = lcFilePath + " does not exist"
                Messagebox (lcMsg)
               return
         endif

         The error still occurs.   So It is not my code that triggers "File does not exist".

    4)  I added back the above IF block with an added ELSE statement:
                  if empty(sys(2000,lcFilePath)) then
                      lcMsg = lcFilePath + " does not exist **** !!!"
                    Messagebox …
0
I need a method to be able to return multiple values.

I need to send a program name to a method and have it return a list of parameters for that program based on selections and entries on a form.

do LoadParms with myProgramName


LoadParms()
parm1 = thisform.text1.value
parm2 = thisform.text2.value
parm3 = thisform.text2.value

return parm1, parm2, parm3
0
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

How do I get a value from a particular column of the selected row in multi column list box in VFP?

v = thisform.myListBox... ?  Value of column 2
0
I am trying to capture the datetime value at the completion of a program called by a form.

The form calls the program with this code:
-------------------------------------------
if v = "load2_loopj.prg" then
       do load2_loopj.prg with lnWeekNum, cProd, cPetPics
 
endif

I have this code at the end of the load2_loopj.prg:
---------------------------------------------
      d = ttoc(datetime())
       return d

How do I capture the value of d in the form?

Is this the correct way to do this?
0
How do load a date field into a foxpro list box?

This is what i have tried:

thisform.lstProcs.AddListItem(dtoc(starttime)),lnI,4) && 3rd col
0
After uninstalling Office 2010 and installing Office 365 I cannot export to Excel from VFP.

The line
     loExcel = CREATEOBJECT("Excel.Application")
generates the error
    OLE error code 0x80040154: Class not registered.

I am seeing some suggested solutions online, but am wondering if they apply to the latest version of Office.  Locating the Office version in Excel shows
     Microsoft Excel for Office 365 MSO (16.0.11126.20234) 32-bit

Thanks in advance!
0
I am trying to streamline some old clunky VFP procs that I am having to run manually and manually edit variable values in prg's.

So ... I am loading the prg names and locations into a list box and grabbing them from there to kick off the prgs with a command button.

Too much info ..

The problem is I am getting "File Name does not exist" - not so.  

It is the same whether I get the filename from the list box and call  the it using a variable name or hard code the prg name.

Here's my code:

       vFileName = THISFORM.list1.value
      vParmName = thisform.text1.value  **not using parameter in call yet
                              *set default to "C:\Users\Denise\Dropbox\Boomerang\TestCode"
      


      *do C:\Users\Denise\Dropbox\Boomerang\TestCode\&vFileName
      ** error = "test1.prg does not exist

      do C:\Users\Denise\Dropbox\Boomerang\TestCode\test1.prg
      ** error = "test1.prg Name does not exist
0
Hi experts

I'm planning to make the user's license (just a file that remains with the .exe) of an VFP app I developed readable (and visible) only by the app and not for Windows Explorer, do you know a way to do that?

When  the app starts, the code have to check if the file is not readable  and if so, make it readable just for the app obtain license information and then to make it not readable (and visible) again.

Thanks in advance
0
Hello everyone,

I have a parameter view (lv_prname) that I am passing a name string on a VFP form.  The view is tied to a grid resource in a grid.  The view is using a "Like" sql statement.  When I pass a name value (example "TOM J", the view is not returning all the records that I have in the table.  I know I have 25 records in the table that should match, but it returns on 19 records.

My code that I am running

with thisform
do case

....
....
	case .a = 2 && processed record by name
		c = alltrim(.t1.value)
		lc_name = ALLTRIM((c)+'%')
		.Grid1.recordsource = 'lv_prcname'
		requery('lv_prcname')
		.Grid1.refresh()
		.parm2 = lc_name
		b = reccount('lv_prcname')
		.hqp = lc_name
		if b = 0
			messagebox('No Records Found',0,'Record Not Found Message')
			.cmdquit.setfocus()
			.cmdok.visible = .f.
			.refresh()
		else
			.cmdok.visible = .t.
		endif	

Open in new window



My local query view has following

SELECT * FROM payroll!payroll_tbl WHERE Payroll_tbl.fname LIKE ?lc_name ORDER BY Payroll_tbl.fname

DBSetProp(ThisView,"View","Comment","processed rec view for like names"+CHR(13))
DBSetProp(ThisView,"View","SendUpdates",.F.)
DBSetProp(ThisView,"View","BatchUpdateCount",1)
DBSetProp(ThisView,"View","CompareMemo",.T.)
DBSetProp(ThisView,"View","FetchAsNeeded",.F.)
DBSetProp(ThisView,"View","FetchMemo",.T.)
DBSetProp(ThisView,"View","FetchSize",100)
DBSetProp(ThisView,"View","MaxRecords",-1)
DBSetProp(ThisView,"View","Prepared",.F.)

Open in new window

0
I am using VFP 8.0.  I have a textbox that has some value.  How can I check if that value changed from original value?

thanks
Nick
0
I am trying to create a DSN to link to a Visual Foxpro 5 table from Microsoft Access (Office 365).  I am using Windows 10.
0
Become a Microsoft Certified Solutions Expert
LVL 13
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

A combobox control I am adding to a Visual Foxpro 9 form shows only the first item in the list.
I am creating a two column array from a table, and the debugger shows all rows are created.
If the record in main table in the form is tied to that first item, the item shows up in the control.
If not, the control is blank.
I can drop down the list, pick the one item, and it will now be tied to the main table in the save procedure, and appear in the combo box if I call up that record again.
So the create array procedures and save procedures seem to be working, but I am only seeing the first record in the array on the form. .
I have used this combobox class for many years, although not recently.

RoWSource is 'this.aitems' which seems to be created properly.
RowSourceType is 5-Array

Any thoughts?
0
I have created a serie of executable files that each generate a specific report on the server.(Visual Foxpro 9).

I need to enable the user , but doing something (send an email., copy a file to a folder, do anything that will trigger that executable file.
I can not give him access to the server. and there are many executables.. (around 20)

I was thinking of creating a watchdog on a folder... but don't know how to do this in Visual Foxpro
0
I have a client asking about their VFP app being able to export data to QuickBooks.  I am wondering if anyone has suggestions on how to best go about making that work, using 3rd party tools or otherwise?
0
I have a client asking about their VFP app with a SQL backend database being able to import/export data from SalesForce (www.salesforce.com).  I am wondering if anyone has suggestions on how to best go about making these tasks work, using 3rd party tools or otherwise?
0
Hi Experts

Could you point a strategy to access a DB that remains at AWS cloud by using Visual FoxPro?

The reason it to reuse an alrealdy developed app to do that.

Thanks in advance!
0
I have a Visual FoxPro program running. it uses a local cursor engine.
To use the program from home, people use a VPN solution (openVPN)

Using this, we have poor performance.
We use lines with a 200mbit down and 50 mbit upload speed.  (vendor = Telenet Belgium)

The database has a traffic of 100mbyte totally  during a complete session, so it should fly.
However: on a 100Mbit network it works realtime. response times are very low.

Using openVPN, response times are like minutes.
The internet connection is real fast. So OpenVPN is what slows us down.

I put send and receive buffers to 0 in both server and ws config file. This fastenes the systyem up, but far..  far from enough.

There must be other settings to speed openVPN traffic up. But what can I do?
0

FoxPro

Visual FoxPro (VFP), and its predecessor FoxPro, is a data-centric, object-oriented, procedural, database programming language and IDE from Microsoft last released in 2007 that still has some active use due to its low cost of deployment and fairly rapid development. In 2008, Microsoft released a set of add-ons for VFP's xBase components to allow interoperability with various Microsoft technologies. It allows data processing against its native file-based data tables or database servers such as SQL Server.

Top Experts In
FoxPro
<
Monthly
>