Discussion:
why my seeker is not working...
(too old to reply)
unknown
2008-11-07 07:06:25 UTC
Permalink
On Fri, 7 Nov 2008 00:39:26 -0500 IvanBenttini
Sender: "IvanBenttini" <***@nc.rr.com>
wrote the following in:
Newsgroup: dbase.programming
Hi,
Some how I am missing some small detail.
Can anyone point me in the right direction by looking in my code?
I want to use the seeker to navigate my grid and see my entryfields change.
Thanks in advance,
Ivan
Ivan,

The turnkey is not running because of missing files.

The missing files are Names.mdx, Names.dbt and States.dbf with States.mdx and States.dbt if any.


Ivar N. Jessen
Ivan Benttini
2008-11-09 00:15:47 UTC
Permalink
Ivar,
Thanks friend, you are great.
this some how was missing in the code of my datamodule.
Mea culpa...I thought, it did happen auto. when I create
the datamodule. I will never finish learn dBase as ou can see...

//////////////////////////////////////////////////
with (this.NA1.rowset)
//autoEdit = false
indexName = "FNAME"
endwith
//////////////////////////////////////////////////

The above lines of code plus the creation of the INDEX with the lines below
// close databases
// use NA exclusive
// index on upper(fname) tag fname
// close databases
is a must for SEEKER to work happy, I know now.

Now maybe you can help me with an [ if ] statement to go in my code just
before the form opens, as like the "text" below:

**************************************************
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
**************************************************

since I could not find anything on the help file for this,
and I am assuming that the above code create an .mdx
index file, am I right?
I just would like that to be on the form code always, in case
later the index gets corrupted. What you think?
Just remember, with my questions, I only knows maybe 10%
of what you do, OK!. Thanks for undestanding.

Ivan :)
On Fri, 7 Nov 2008 17:11:19 -0500 IvanBenttini
Newsgroup: dbase.programming
Hi Ivar,
Thanks again for your kindness, but I do have all the 'pieces' you
mention.
I thought that seekerForm.wfm was ready to run when copied and pasted to a
new folder.
I got to be missing some. Can you help me again...and again...? (smile)
Please look on my dataModule(dm1.dmd) text above.
As you can see on my (seekerform.wfm) text above, everything was created
ONCE.
I also have everything inside of the some folder,
the (Names.dbf - Names.dbt -Names.mdx) and (States.dbf - States.dbt -
States.mdx),
and of course seekerform.wfm.
Nice to know that everything is in the same folder, but why not tell us in
which folder it is and if
'everthing' also includes dm1.dmd?
So now we have to guess <sigh>
According to seekerForm.wfm the dm1.dmd is in the Samples folder. Let us
assume that 'everything'
includes the datamodule, in which case the tables are also in the Samples
folder. The seekerForm can
be in any folder, as it contains code to point at the table and the
datamodule.
Now how does the code point to the tables? Look into the datamodule, it
specifies a database named
"dBASE Files". A database of this name is found in the BDE and it uses a
Microsoft dBase driver,
which is an ODBC driver. As nothing was said about ODBC drivers, and the
tables are in the Samples
folder, let us guess that the dabase should be the one named
"dBaseSamples" and which by sheer luck
points to the Samples folder.
The best guess ( untested, no guarantee ) is that the form should work
when the database name is
changed from "dBASE Files" to "dBaseSamples" :-)
Ivar B. Jessen
Geoff Wass [dBVIPS]
2008-11-09 06:16:45 UTC
Permalink
Post by Ivan Benttini
Ivar,
Thanks friend, you are great.
this some how was missing in the code of my datamodule.
Mea culpa...I thought, it did happen auto. when I create
the datamodule. I will never finish learn dBase as ou can see...
//////////////////////////////////////////////////
with (this.NA1.rowset)
//autoEdit = false
indexName = "FNAME"
endwith
//////////////////////////////////////////////////
The above lines of code plus the creation of the INDEX with the lines below
// close databases
// use NA exclusive
// index on upper(fname) tag fname
// close databases
is a must for SEEKER to work happy, I know now.
Now maybe you can help me with an [ if ] statement to go in my code just
**************************************************
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
**************************************************
since I could not find anything on the help file for this,
and I am assuming that the above code create an .mdx
index file, am I right?
I just would like that to be on the form code always, in case
later the index gets corrupted. What you think?
Just remember, with my questions, I only knows maybe 10%
of what you do, OK!. Thanks for undestanding.
Ivan :)
Ivan,

Yes, your INDEX command created added an index to your .MDX file. If
this was the first index of the table, then the command created the .MDX
file, too.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Ivan Benttini
2008-11-09 17:07:47 UTC
Permalink
Thanks Geoff as always.
You are always a great help and teacher just like Ken and others.
Have a nice sunny Sunday.
Ivan
Post by Geoff Wass [dBVIPS]
Post by Ivan Benttini
Ivar,
Thanks friend, you are great.
this some how was missing in the code of my datamodule.
Mea culpa...I thought, it did happen auto. when I create
the datamodule. I will never finish learn dBase as ou can see...
//////////////////////////////////////////////////
with (this.NA1.rowset)
//autoEdit = false
indexName = "FNAME"
endwith
//////////////////////////////////////////////////
The above lines of code plus the creation of the INDEX with the lines below
// close databases
// use NA exclusive
// index on upper(fname) tag fname
// close databases
is a must for SEEKER to work happy, I know now.
Now maybe you can help me with an [ if ] statement to go in my code just
**************************************************
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
**************************************************
since I could not find anything on the help file for this,
and I am assuming that the above code create an .mdx
index file, am I right?
I just would like that to be on the form code always, in case
later the index gets corrupted. What you think?
Just remember, with my questions, I only knows maybe 10%
of what you do, OK!. Thanks for undestanding.
Ivan :)
Ivan,
Yes, your INDEX command created added an index to your .MDX file. If
this was the first index of the table, then the command created the .MDX
file, too.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Geoff Wass [dBVIPS]
2008-11-10 05:00:16 UTC
Permalink
Post by Ivan Benttini
Thanks Geoff as always.
You are always a great help and teacher just like Ken and others.
Have a nice sunny Sunday.
Ivan
Ivan,

You're welcome. I hope you had a good weekend, too.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Marilyn Price
2008-11-09 14:56:56 UTC
Permalink
Post by Ivan Benttini
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
If na.dbf is in the current folder, then

if file(na.mdx)

is sufficient.

If it is not, then you'll need to preface na.mdx with the path to where
it should be. If you're using BDE aliases, then there's (if memory
serves) a function in the dUFLP which allows you to extract the path
name from the BDE....
--
Marilyn Price
M. P. Data
Ivan Benttini
2008-11-09 15:36:05 UTC
Permalink
Hi Marilyn,
Nice to meet you. My name is Ivan Benttini.
Thanks for jump in in trying to help me.
Everything is in the same folder as you ask.
It did not work yet.
This is the error I get:
Error: variable undefined: NA
It happens when I did code as below:

if (na.mdx)
msgbox("File already exist")
else
close databases
use na exclusive
index on upper(fname) tag fname
close databases
endif
THEN I try with the whole path code as such:

if (c:\AB\na.mdx)
msgbox("File already exist")
else
close databases
use na exclusive
index on upper(fname) tag fname
close databases
endif
AND IT TELLS ME I HAVE AN UNBALANCED PARENTHESES
I am loosing my hair (and I dont have much as of now)
can you continue to help me?
Ivan

** END HEADER -- do not remove this line
//
// Generated on 11/08/2008
//
===========================================
Post by Marilyn Price
Post by Ivan Benttini
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
If na.dbf is in the current folder, then
if file(na.mdx)
is sufficient.
If it is not, then you'll need to preface na.mdx with the path to where
it should be. If you're using BDE aliases, then there's (if memory
serves) a function in the dUFLP which allows you to extract the path
name from the BDE....
--
Marilyn Price
M. P. Data
Ivan Benttini
2008-11-09 17:04:35 UTC
Permalink
Thanks Ken,
Your way is simpler then my and more elegant.
Thanks for take the time to help
Ivan
Post by Ivan Benttini
Hi Marilyn,
Nice to meet you. My name is Ivan Benttini.
Thanks for jump in in trying to help me.
Everything is in the same folder as you ask.
It did not work yet.
*/Error: variable undefined: NA/*
if (na.mdx)
if file("na.mdx")
file() is the name of the function, and the name of the file you are
looking for must be in quotes.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]
2008-11-09 18:29:02 UTC
Permalink
Post by Ivan Benttini
Thanks Ken,
Your way is simpler then my and more elegant.
Thanks for take the time to help
Glad to help out. It's what we do in these newsgroups ...

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]
2008-11-09 15:54:46 UTC
Permalink
Post by Ivan Benttini
Hi Marilyn,
Nice to meet you. My name is Ivan Benttini.
Thanks for jump in in trying to help me.
Everything is in the same folder as you ask.
It did not work yet.
*/Error: variable undefined: NA/*
if (na.mdx)
if file("na.mdx")

file() is the name of the function, and the name of the file you are
looking for must be in quotes.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Marilyn Price
2008-11-10 12:58:17 UTC
Permalink
Post by Ivan Benttini
Hi Marilyn,
Nice to meet you. My name is Ivan Benttini.
Thanks for jump in in trying to help me.
Everything is in the same folder as you ask.
It did not work yet.
Error: variable undefined: NA
if (na.mdx)
Sorry about leaving off the quotes. I was typing faster than I was
thinking....
--
Marilyn Price
M. P. Data
Ivan Benttini
2008-11-09 16:09:54 UTC
Permalink
Hi Again Marilyn,
I try this piece of code and I got the msgBox message.
It seems that works now, but double check it for me, since
I am sure you have more experience than me.
////////////////////////////////////////////////////////////////////
#define filename "NA.mdx"
f=new file()
if f.exists(filename)
msgbox("File already exist.")
else
close databases
use na exclusive
index on upper(fname) tag fname
close databases
endif
/////////////////////////////////////////////////////////////////////
Thanks for your participation in helping me, and in
my broke english from time to time.
dBase can do anything, I am the one that takes too
long to learn things.
Ivan
Post by Marilyn Price
Post by Ivan Benttini
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
If na.dbf is in the current folder, then
if file(na.mdx)
is sufficient.
If it is not, then you'll need to preface na.mdx with the path to where
it should be. If you're using BDE aliases, then there's (if memory
serves) a function in the dUFLP which allows you to extract the path
name from the BDE....
--
Marilyn Price
M. P. Data
Marilyn Price
2008-11-10 13:00:54 UTC
Permalink
Post by Ivan Benttini
Hi Again Marilyn,
I try this piece of code and I got the msgBox message.
It seems that works now, but double check it for me, since
I am sure you have more experience than me.
////////////////////////////////////////////////////////////////////
#define filename "NA.mdx"
f=new file()
if f.exists(filename)
That's similar to the way I usually use the command. Usually, the name
of the file is in a variable, so somewhere in the program there's a:

myfile = "whatever.dbf"

Then later:

if file(myfile)
....

As long as the argument for the file() function is a character, that's
all that matters.
--
Marilyn Price
M. P. Data
Ivan Benttini
2008-11-10 20:03:31 UTC
Permalink
Many Thanks for your time never the less.
Ivan
Post by Marilyn Price
Post by Ivan Benttini
Hi Again Marilyn,
I try this piece of code and I got the msgBox message.
It seems that works now, but double check it for me, since
I am sure you have more experience than me.
////////////////////////////////////////////////////////////////////
#define filename "NA.mdx"
f=new file()
if f.exists(filename)
That's similar to the way I usually use the command. Usually, the name
myfile = "whatever.dbf"
if file(myfile)
....
As long as the argument for the file() function is a character, that's
all that matters.
--
Marilyn Price
M. P. Data
unknown
2008-11-09 19:18:00 UTC
Permalink
On Sat, 8 Nov 2008 19:15:47 -0500 Ivan Benttini
Sender: "Ivan Benttini" <***@nc.rr.com>
wrote the following in:
Newsgroup: dbase.programming
Post by Ivan Benttini
Ivar,
Thanks friend, you are great.
Ivan,

I am glad if my reply was of any help, although I don't really understand in which way it helped.

I know you have only used dBase Plus and the newsgroup for a short time and it looks like you are
doing fine, but let me suggest, that when you post some code and ask for comments, then please stick
to the code you posted.
Post by Ivan Benttini
this some how was missing in the code of my datamodule.
Mea culpa...I thought, it did happen auto. when I create
the datamodule. I will never finish learn dBase as ou can see...
What was missing, and what should happen auto?
Post by Ivan Benttini
//////////////////////////////////////////////////
with (this.NA1.rowset)
//autoEdit = false
indexName = "FNAME"
endwith
//////////////////////////////////////////////////
The above lines of code was not in the message you posted, and they deal with a query named NA1. Why
do you introduce a new query and how does it relate to the code in the original posting?
Post by Ivan Benttini
The above lines of code plus the creation of the INDEX with the lines below
// close databases
// use NA exclusive
// index on upper(fname) tag fname
// close databases
is a must for SEEKER to work happy, I know now.
When I saw your original code I got the impression that you had read the instructions in the header
of seeker.cc and already knew that an index was needed.

A much better success report would have been something like this:

"Thanks, I solved the problem by making the following changes to the code in the datamodule:

Changed the databasename from "dBase Files" to "dBaseSamples" and by uncommenting the lines
indicated below.

sql = 'Select * from "Names"'
active = true
endwith
//with(this.NAMES1.rowset) // <--- uncommented
//indexName="fname" // <--- uncommented
//masterRowset=form.NAMES1.rowset
//masterFields="NAMES1"
//endwith // <--- uncommented"
Post by Ivan Benttini
Now maybe you can help me with an [ if ] statement to go in my code just
**************************************************
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
**************************************************
since I could not find anything on the help file for this,
Open the help file, select Tab 'Search'. In the field marked '1.' type the words: file exist. In
field marked '3.' scroll down to find a likely topic, when you arrive at the letter e you will
notice 'exist() [File}. It looks promising, select it and read the explanation and study the code in
the example.

Now go back to the Search Tab an select the next topic, which is 'File commands and functions'. Open
it and read the explanation; the is nothing we can use. The try the next Topic, 'File information
functions', open it and notice that it talks about File class method 'exists()' and a similar
function File(). We now have two ways to check if a file exists. Did you use the help file in this
way to seach for a useable function?

You could also go to Help -> Language Reference -> Files and Operating System. Then start from the
top and at the third Topic you will find what you are looking for.
Post by Ivan Benttini
and I am assuming that the above code create an .mdx
index file, am I right?
Maybe, who knows :-) If you close the database where the table is how would you open the table?
Post by Ivan Benttini
I just would like that to be on the form code always, in case
later the index gets corrupted. What you think?
It should not be necessary. If the index becomes corrupted find out why it happens and take steps to
prevent it.


Ivar B. Jessen
Ivan Benttini
2008-11-09 20:11:25 UTC
Permalink
Thanks Ivar,
Little by little I am geting together with the "program", most of the
BOO-BOO's are in my side of course, I am working hard to aviod them, I will
do better next time, I promisse.
Thanks for your patience and understanding. Your help and rest of this group
members is very important to me.
I have resolve the problems with the indexes, everything is runing OK, many
thanks
to you all.
Have a nice week.
Ivan
PS: Please try if you can, and have the time, to help me with my next
posting about checking if a form is already Open.
Post by unknown
On Sat, 8 Nov 2008 19:15:47 -0500 Ivan Benttini
Newsgroup: dbase.programming
Post by Ivan Benttini
Ivar,
Thanks friend, you are great.
Ivan,
I am glad if my reply was of any help, although I don't really understand
in which way it helped.
I know you have only used dBase Plus and the newsgroup for a short time
and it looks like you are
doing fine, but let me suggest, that when you post some code and ask for
comments, then please stick
to the code you posted.
Post by Ivan Benttini
this some how was missing in the code of my datamodule.
Mea culpa...I thought, it did happen auto. when I create
the datamodule. I will never finish learn dBase as ou can see...
What was missing, and what should happen auto?
Post by Ivan Benttini
//////////////////////////////////////////////////
with (this.NA1.rowset)
//autoEdit = false
indexName = "FNAME"
endwith
//////////////////////////////////////////////////
The above lines of code was not in the message you posted, and they deal
with a query named NA1. Why
do you introduce a new query and how does it relate to the code in the original posting?
Post by Ivan Benttini
The above lines of code plus the creation of the INDEX with the lines below
// close databases
// use NA exclusive
// index on upper(fname) tag fname
// close databases
is a must for SEEKER to work happy, I know now.
When I saw your original code I got the impression that you had read the
instructions in the header
of seeker.cc and already knew that an index was needed.
"Thanks, I solved the problem by making the following changes to the code
Changed the databasename from "dBase Files" to "dBaseSamples" and by uncommenting the lines
indicated below.
sql = 'Select * from "Names"'
active = true
endwith
//with(this.NAMES1.rowset) // <--- uncommented
//indexName="fname" // <--- uncommented
//masterRowset=form.NAMES1.rowset
//masterFields="NAMES1"
//endwith // <--- uncommented"
Post by Ivan Benttini
Now maybe you can help me with an [ if ] statement to go in my code just
**************************************************
if file (NA.mdx) already exist (I don't know how to code this line)
//don't do nothing
else
close databases
use NA exclusive
index on upper(fname) tag fname
close databases
endif
**************************************************
since I could not find anything on the help file for this,
Open the help file, select Tab 'Search'. In the field marked '1.' type the
words: file exist. In
field marked '3.' scroll down to find a likely topic, when you arrive at
the letter e you will
notice 'exist() [File}. It looks promising, select it and read the
explanation and study the code in
the example.
Now go back to the Search Tab an select the next topic, which is 'File
commands and functions'. Open
it and read the explanation; the is nothing we can use. The try the next
Topic, 'File information
functions', open it and notice that it talks about File class method
'exists()' and a similar
function File(). We now have two ways to check if a file exists. Did you
use the help file in this
way to seach for a useable function?
You could also go to Help -> Language Reference -> Files and Operating
System. Then start from the
top and at the third Topic you will find what you are looking for.
Post by Ivan Benttini
and I am assuming that the above code create an .mdx
index file, am I right?
Maybe, who knows :-) If you close the database where the table is how
would you open the table?
Post by Ivan Benttini
I just would like that to be on the form code always, in case
later the index gets corrupted. What you think?
It should not be necessary. If the index becomes corrupted find out why it
happens and take steps to
prevent it.
Ivar B. Jessen
unknown
2008-11-08 15:41:02 UTC
Permalink
On Fri, 7 Nov 2008 17:11:19 -0500 IvanBenttini
Sender: "IvanBenttini" <***@nc.rr.com>
wrote the following in:
Newsgroup: dbase.programming
Hi Ivar,
Thanks again for your kindness, but I do have all the 'pieces' you mention.
I thought that seekerForm.wfm was ready to run when copied and pasted to a new folder.
I got to be missing some. Can you help me again...and again...? (smile)
Please look on my dataModule(dm1.dmd) text above.
As you can see on my (seekerform.wfm) text above, everything was created
ONCE.
I also have everything inside of the some folder,
the (Names.dbf - Names.dbt -Names.mdx) and (States.dbf - States.dbt -
States.mdx),
and of course seekerform.wfm.
Nice to know that everything is in the same folder, but why not tell us in which folder it is and if
'everthing' also includes dm1.dmd?

So now we have to guess <sigh>

According to seekerForm.wfm the dm1.dmd is in the Samples folder. Let us assume that 'everything'
includes the datamodule, in which case the tables are also in the Samples folder. The seekerForm can
be in any folder, as it contains code to point at the table and the datamodule.

Now how does the code point to the tables? Look into the datamodule, it specifies a database named
"dBASE Files". A database of this name is found in the BDE and it uses a Microsoft dBase driver,
which is an ODBC driver. As nothing was said about ODBC drivers, and the tables are in the Samples
folder, let us guess that the dabase should be the one named "dBaseSamples" and which by sheer luck
points to the Samples folder.

The best guess ( untested, no guarantee ) is that the form should work when the database name is
changed from "dBASE Files" to "dBaseSamples" :-)


Ivar B. Jessen
Loading...