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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CursorGetProp("tables") not returning table name

Status
Not open for further replies.

Kflasph

Programmer
Apr 8, 2002
65
US
I have a program where I am extracting the table name via CursorGetProp("tables"). I am processing approx 20 tables and this function works great on all tables except one.
I cannot understand why this is not working for one table!!
I far as I can tell, there is nothing different about this table (other than the obvious - column names, table name, indexes).
Does anyone know of any issues with this function or what I can look for with this table to return the values I need?

Thanks in advance,
KFlasph
 
JustStem(DBF()) gives you the name of the physical DBF file. If that's what you want, then do as Dan suggests.

CursorGetProp("tables") gives you a comma-delimited list of the remote tables involved in an update. It is used with cursors (typically those generated by remote views) that derive from a query on a back-end server. It is not the same as JustStem(DBF()).

Kflasph, perhaps you could clarify which of those you are interested in.

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks for quick responses!
Mike hit the nail on the head as to how the current function is working. The function using the CursorGetProp('tables') has been in place for some time and works perfectly with all other cursors being used except this one.
I'm having to change a program to add another cursor to a list of existing calls to cursors created in the program and it's only the one I have added that is not returning the table name. Is there anything 'special' I need to do to a cursor before using this function?

Again - thanks for the quick response

KFlasph
 
Is it not possible to hard-code the table name in that one particular case? In other words, instead of calling CURSORGETPROP("tables") and then using the returned value in some way, just use the actual table name? Presumably, you know the name of the table, because you used it in the query that generated the cursor in the first place.

If that won't work for some reason, perhaps you could explain why you need to call CURSORGETPROP("tables"), and how you are using the value that it returns.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
What's different about that one cursor that isn't working? Remember, we can't see through your eyes. Is it a different data source? A different connection?

I see that Mike is assuming this is for remote data, which may not be the case.

You've been sufficiently vague so far, so this thread may go on for a while. [bigsmile]
 
As far I a can tell, there is nothing different from the one cursor I am using from the others being called in the program. That is why I am at a loss at to why it is not working. The new cursor is called/created the exact same way the other cursors in the program are created.

I'll take Mike's suggestion and instead of using the CURSORGETPROP function, I will hard code the table name. I was just hoping there was a setting of some sort I was missing to get the function to work.

Thanks for your help,
KFlasph
 
I'll take Mike's suggestion and instead of using the CURSORGETPROP function, I will hard code the table name.

I'm sure that you, like me, would have preferred to get the bottom of the problem, rather than using the workaround I suggested. Unfortunately, it's very difficult for us to debug this sort of issue when we know so little about the context or the code - or what you are tying to achieve.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
The new cursor is called/created the exact same way the other cursors in the program are created.

How are they created? You still haven't said.

We'd all kind of like to get this sorted in case it ever happens to *us*. [glasses]
 
How about showing some code So we don't talk about a movie we haven't seen yet.

Not every cursor has this set as information about where the data is coming from. The tables property of cursors is not set for cursors you create with CREATE CURSOR. And CURSORGETPROP("tables") even errors for cursors created via a query INTO CURSOR. While you're sure you create this new cursor as any other before, you don't use the alias parameter, are you sure you have the cursor you're interested in in the current workarea?

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top