my app has to deal with a lot of dbf which sometimes get
corrupted.  upon checking, the corruption is most likely due to
some additional bytes after the logical end of the file.  the
problem is vfp9 refuses to open it with error 2091:

table "name" has become corrupted. the table will need to be repaired before using again.

it always puzzle me why vfp does not any built-in dbf repair command
(not even the simple one) although it has a native dbf engine.

lately the frequency of corruption get to a point becomes
annoying.  so i look around the… Continue reading

i would like to do something (update a table) when a report is printed from the preview windows.

the old way of setting a variable in the report and checking it afterward does not work with an object-assisted report because sys(2040) is not designed to work with the new behavior of the new reporting mechanism of vfp9.

llprinted = .f.
report form xxx to printer prompt object type 1
if llprinted
   ? "printed"
endif

and in the report set llprinted to .t. if sys(2040)="2".  llprinted is always .f. even when the user prints the report.

after a few message… Continue reading

i use data explorer (dx) to browse a sql server 2000 database in a project.  if i don’t select sort objects in the sql connection properties dialog, then i get a list of all the sproc in random order when i expand the stored procedure node.

 

 

if i select sort objects, then i get an empty list!

 

 

northwind does not have this problem.  only my database has this problem.  so i dig into xsource and narrow down the problem to this line of code in sqldatabasemgmt.ongetstoredprocedures() defined in datamgmt_sql.prg

 

text to… Continue reading

adel gharib has submit a tip of the month in advisor guide to visual foxpro july 2006 issue to create a distributable command window which can be embedded into a compiled vfp exe.  i have worked on adel's tip and package the code into a class (commandprompt of sysadmin.vcx).

i use the accept command instead of the inputbox command suggested by ceil because it acts more like a command window that way.  and a form is used as the input/output service. 

to open the command prompt window, run the following code in the vfp command window or through a menu pad or… Continue reading

i haven't done any client/server work with vfp yet but plan to do so.  i am thinking of should i use msde or mysql. 

mysql now has gui frontends similar to enterprise manager and query analyser.

mysql admin
http://www.mysql.com/products/tools/administrator/

mysql query browser
http://www.mysql.com/products/tools/query-browser/

i haven't tried them yet but their screenshots look promising.  with these tools, it would be easier to do ad-hoc maintenance job at the client site.  this is a plus for mysql.  on the other hand, msde does not come with any gui front end, so it will be more difficult to manage it at the client's site,… Continue reading

all i am doing is to use ole automation to open an existing excel spreadsheet, read a value from a particular cell, then close the worksheet.  that's all.

i thought i didn't do any update to the worksheet so didn't take any precaution when closing the spreadsheet, assuming(!) that it will just close properly.  it works in my development pc.

but it doesn't work in production.  excel popped up a dialog upon closing the spreadsheet and hanged my application.  guess what that is?

excel was suggesting to save the spreadsheet to a new version and asking the user to confirm,… Continue reading

my development pc is a windows 2000 prof while my client runs windows xp.  in one of the forms in the application there is a grid, and i have changed the forecolor of the grid column header caption to either red or green depending on some condition.

the conditional caption coloring works as expected in windows 2000 but not in windows xp.  it does not show the green color even when the condition is met.  the way to make it works is to set the grid's themes property to .f., i.e. do not use xp themes.

one of the reasons that i enjoyed using vfp to do my development work is it runs on lesser hardware. in fact i can run vfp9 comfortably in my pentium iii 600mhz laptop that i bring with me to my client site. in fact vfp7 to vfp9 requires more or less the same hardware to run. i also use vs, vs2003 runs okay in my laptop, but never mind vs2005 especially the web developer portion. it is just too slow. okay okay, as a developer i should buy a fast machine with lots of memory, but in reality i just… Continue reading

the roles supported by vs2005 team system are infrastructure architect, solution architect, developer, tester and project manager. i, being a solo software developer, develop software for small/medium business. i find myself assuming all these roles albeit in smaller scale.

sometimes i cut corners when switching among these roles, and over time, gradually blurring the lines between them which is not a good way to develop software. i feel great that the team system reminds me of these distinct roles again, even though vs2005 is not my primary development system. you can always learn something from anything if you keep an open mind.

.net is like a tank, vfp is like a jeep. a tank cannot behave a jeep, a jeep cannot behave a tank.