Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can you use onedrive for DBF for networking access? 1

Status
Not open for further replies.

Mandy_crw

Programmer
Jul 23, 2020
578
PH
Hi everyone.. i have created an appplication in VFP, my question is, can i use Onedrive for online/local access of the DBF's? thanks...
 
Mandy, it's difficult to answer this question without knowing the actual command or function which generated the error. And that's difficult to discover when you are running from an EXE. While you are still testing your application, it's better to run it in the development environment (that is, without building the EXE). That way, when an error occurs, you will see a message with Cancel / Suspend / Ignore buttons. By clicking on Suspend, you can reach the debugger to find out the actual line of code that caused the error.

In general, "Table has no index order set" comes up when you try to execute a command that requires the table to have an index in force. Off-hand, the only two commands I can think of that fall into that category are SEEK and SET RELATION. It's likely that it is one of those commands that is causing your problem.

Note that having no index order set is not the same as having no index. The table may well have an index, but unless you specifically specify the index order with the SET ORDER TO command or the ORDER clause in the USE command, the index will not be in force.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I second Mike, this is very vague to give an answer, the reason for the error is already explained.
When you followed the advice of USE table ORDER indextag, then you should not mix it up with putting tables into the (visual) DE, too. There the order can be set as a property of the object for a table.

You know you always need to SELECT 0 first or USE IN 0 so one USE doesn't close a previously opened table. And then when you finally SEEK or SET RELATION or do anything else causing this error, you could also simply fail on having the wrong active workarea.

Chriss
 
I don't think Mandy's indexes are structural, so set order to... bit moot - no index tags

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
USE has clauses for both CDX index tags and IDX files. So no problem. As Mike said the error occurs when you execute a command which depends on the index, not when you set order to it or use a table with it.


Chriss
 
Hi Mike & everyone... everything works well in development environment... no errors is displaying and runs perfectly.... only when i run the exe that the error appears.... thanks...

PROCEDURE LOAD()

SELECT 0
USE transaction shared ALIAS trans ORDER idnum

SELECT 0
USE smsrec shared ALIAS rek ORDER idnum

SELECT 0
USE sms shared ALIAS tsulat ORDER idnum

SET relation TO idnum INTO trans

SELECT idnum, ALLTRIM(sname) + ", " + ALLTRIM(fname) FROM SMS ORDER BY sname, fname INTO CURSOR csrdemo
code...
code....
ENDPROC


PROCEDURE CboIdnum.click()

LOCAL lclname as Character

SELECT tsulat
SET ORDER to idnum

lclname = CsrDemo.idnum

SEEK lclname
code...
code....
ENDPROC​
 
Code:
USE sms shared ALIAS tsulat ORDER idnum
SELECT idnum, ALLTRIM(sname) + ", " + ALLTRIM(fname) FROM SMS ...
FROM SMS probably wont work because sms.dbf was aliased to tsulat.
TRY
Code:
... FROM tsulat
I assume CsrDemo was opened somewhere else?

Steve
 
Yes Steve CsrDemo is opened somewhere in the code.... Thanks i'll try using the alias.... thanks Steve...
 
Or you could stop using DBF completely and start using SQL + SPT or CA.
Im curious why anyone still using DBF for non local access tho? yes, its blazing fast and light, but data corruption is a major issue there.
 
Or you could stop using DBF completely and start using SQL + SPT or CA.

I'm sure Mandy won't mind me saying this, but she is still very much at the learning stage with VFP, and she is clearly working hard to get her application up and running. That's why I (and probably others here) have not suggested the major upheaval that moving to a back-end database server would involve. There are definitely strong arguments in favour of a SQL-based back-end, but right now my guess is that she has enough on her plate.

You mentioned that you have had "major issues" with data corruption. If I was in your place, I would want to find the cause of those issues so that I could do something about it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yes Mike no problem... because you are correct, my goal right now is to let this application up and running... with everyone's help in this forum... i have put so many time and efforts to this project and its actually working well, its just that i wanted to use it with networking capabilities... so learning another one to start from scratch is a no for me... thanks so much Mike and Hardianwn....
 
Ah I understand, its astonishing to know that someone still want to learn VFP in these days (which is I always use in term on desktop app especially RDBMS).
@ Mandy, I can ensure you, in term on database management, VFP is the king.

After you finished up your current project, be sure to learn SQL with SPT / CA (I personally love SPT) with ODBC. It will makes your project far easier and less hassle than using DBF.

@Mike, living at 3rd world country, with power cut-out 1 time each 1-2 months (sometime more than 2 times a month), very limited budget on UPS (plus yearly budget on battery replacement) thought me enough to stay away from DBF hahaha.

 
Hi everyone... almost done with my project with LAN access, I can open the app in three client computers, i can add, edit and preview record in the three client computers, my only problem is, when i add a record in client cmputer 1 to cmptr 3, i cant see the added record ín the server and to other cmputers not unless i restart the appication... Please help.... Thanks....
 
did you re-populate the data on each the app?
I usually did that with a button re-populate the data back , call it refresh button (the method depend on how you call the data)
or, you could "refresh" the data automatically with timer
or you could pass a trigger on each app to refresh them. this rather hard since you have to search which IP they have, checking weather the app open or not, then pass parameter to it

I usually did with a button

DBF, or any data source cant automatically refreshed unless you trigger them
 
Now this is really worth a new thread. As you say you work in LAN now, not with OneDrive, that new question doesn't belong here and deserves a new thread, so please start a new thread, Mandy.

I've had this behaviour and at that time the OpLocks problem was not yet known. Besides more often corruptions and slow access this can also be a symptom, but there might be much easier explanations. If you list data in a grid, click on it, that might show the new record. Hardianwn has a point about refreshing controls by either control.refresh or control.requery where it's possible.

Chriss
 
Yes hardianwn i issued controlrefresh... when you add using client 1 computer, the record newly added is seen in computer client 1, same as through with other client computer, when you add a record in certain client, it will be seen where you have added the record... but in other computer, it cannot be seen, but if you restart the app, it will show the newly added record.... im confused...
anyway thank you so much for the answer...

Ok chris i will create a new thread for this question.... thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top