Discussion Locked

Anyone know anything about the old Foxpro??

0 helpful
12 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I've been wracking my brain for like the past three days with this problem... I am trying to insert data into a Foxpro for Windows 2.6 DBF that has logical fields from an ASP page.

In my SQL Insert query I've tried 1, 0, .T., .F., True, False and a whole slew of other things to get this field to update, and every time I get a "Data Type Mismatch" error. What's the proper value to update it?? I also notice that it flags a syntax error if I try to do something like this:

INSERT INTO table_name(field_name) VALUES(value).. is it not possible under Foxpro 2.6 to specify certain fields to update?? I know my way around SQL, but using this dinosaur is something else entirely.

I'd appreciate any help with this problem.. it's driving me crazy!

EDIT: It appears that the logical field might not be the problem.. it might be a Date field, but again whats the way to insert this? the format mm/dd/yyyy gives a type mismatch error as well.

12 replies

by deadly ernest

input the data in the wrong format - ie text instead of numeric value or vica versa. That is the usual cause of the 'Data Type Mismatch' error.

Check the databass itself as to what it is looking for. It could be it is looking for the data as something like 23-Mar-2006 or 23-Mar-06 or 03-23-2006 or just 03 23 2006 and not 13/23/2006. The error may be the input field break up signals should be a space or a "/" or a ",".

by ranich

If you can't get the data type to work, export the dbase into excel. export your asp data into excel, and merge them accordingly on whatever matches them up and resave the dbase as a foxpro file.

by obiwaynekenobi

Apparantly, Foxpro requires dates to be contained within braces {}. Foxpro is a tricky beast. What I wouldn't give to upgrade it to SQL Server 2005...

by obiwaynekenobi

When I try to do an UPDATE or a DELETE sql command it throws "Feature not available." (when I do it on the ASP page I'm writing it does nothing, but won't save the data). Do I need to set some kind of permissions or something to be able to update or delete records from it?

by radiic

One thing to remember is that when you do an UPDATE or DELETE or PACK on the database you have to have exclusive use of the database. In fox you have to specify upon opeing that database to open it with exclusive use.

Wow i am still wondering why your using foxpro 2.6 why not upgrade the machine to at least visual foxpro that way you would have better tools to work with. And if you think 2.6 is bad and buggy, you should have tried working with foxbase and foxplus, the earlier versions, and of course they are Micro$oft products, they wouldnt be M$ products if they didnt have bugs in them :)

by obiwaynekenobi

The co. I work for has their entire business in Foxpro 2.6 (along with NT 4.5 Small Business Server and a truckload of Win95/98 machines). Every piece of data we use or enter is done through it; it was set up that way years ago and was "really a great solution back then" but management has never seen any reason to ever upgrade it. So I am stuck supporting it for any and all development.

by radiic

WoW...sounds like they are the type that just dont want to change anything. I mean the ol saying "If it ain't broke, don't fix it" doesnt really work these days. They do know that M$ does not support 4.5 anymore so if you have a wicked crash on one of your servers and try to call to get help they will laugh at you. Anyways i know that is not your battle to fight.

Well did exclusive help you. After i posted i starting thinking of the code i use to write. Let me know how you are doing these SQL inserts, because i am trying to think back....Years lets see probably 8 years ago...and i dont remember the tables supporting SQL insertion. Maybe they do and we just never did it.

Well i do feel for ya having to support it.

by obiwaynekenobi

I dont know what I did.. the UPDATE doesnt work from Foxpro itself but it works from the ASP code.

And you're right on the money with the old saying. Sums it up pretty well. But.. I need the job (was out of work for almost 6 months before) so.. thanks for the advice.. and the condolences :)

by pjalexander

The format for dates in FoxPro is {06/13/2006} or {^2006/06/13}, depending on how FoxPro is set up. At least in VFP 5.0, which is the oldest version I use.

Sorry, I haven't figured out how to query a logical field.

by bm_keshav

YOU CAN TRANSFER YOUR FOXPRO DBF FILE INTO MYSQL TABLE. FIRST OF ALL EXPORT YOUR DBF INTO CSV FILE AND THEN INSERT YOUR CSV INTO MYSQL.

BMK

by kodukulla

I'm using erp tools through Foxpro s/w .i'm doing Purchase orders for a particular Ship.Also i'm updating all the status for that ship.But , i'm updating all the status manually.but it takes very long time to update.
So, i need to update all the status at a time , while i am completing each & Every Purchase order, Could , you please help me out?

by rcopquin

You should analize the cursor you get from your SQL database and transform 1 into .T. and 0 into .F. (do not forget the points before and after the letter). As for the date field,
you can use date(2010,5,31). Then issue your insert command as follows:

INSERT INTO table_name(field_name) VALUES(value) just like in SQL

This discussion is closed to new replies.