Re: Grids... simple, but I don't know...
- From: "43fan" <sleap13@xxxxxxxxxxxx>
- Date: Thu, 4 May 2006 13:32:38 -0400
Ok... got that part now(I think)... but then how do I use it? Is there a
control I place on the form to use the view in? Initially was going to use
a grid box to have everything in, as I could name the tags on the fields the
way I wanted, put the fields in the order I wanted, etc...
In the original FPD program, it just creates a window and then does a browse
within that window.
I tried using the grid box I already have on the form, but evidently not
doing something right there either, as it doesn't show any data. But if I
just run the code, then do a "use myview" and a browse, it shows up fine.
Thanks!!
"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:%238gX7Z5bGHA.3956@xxxxxxxxxxxxxxxxxxxxxxx
You're tripping over terminology.
For years in Fox2x and prior, we called a dbf file a database. It isn't.
It's a table. A database is a collection of tables, relations, indexes,
and
views. In VFP, it's represented by a DBC and you open it with the OPEN
DATABASE command.
You're not using any of the database features in your Fox2x app because
they're not supported, but you can still use views from VFP. They must be
stored in a DBC.
CREATE DATABASE MyData
* From here on in, just
* OPEN DATABASE myData
CREATE SQL VIEW myview AS SELECT * FROM alignmentdatabase;
WHERE vehicle = ?lcVehicle
* From here on in, just
* lcVehicle = "137"
* USE myview
Dan
43fan wrote:
That's where I'm getting somewhat confused(more than somewhat
actually). Alignmentdatabase is not a VFP database. It's a free
table(FPD2.6 dbf file). I "use alignment" prior to trying the create
sql view command, and still get the same error message. I'm not
understanding now to open a DB(that I won't be using anything from,
what needs to be in it?) and also then use a free table to get the
info I need.
"JWB" <none@xxxxxxxx> wrote in message
news:WNo6g.63$WP5.36@xxxxxxxxxxxxxxxxxxxxxxxx
you have to have the DB open. I use open database and set default.
if !dbused('MyDB')
open database (cDefdata) + 'MyDB'
endif
set database to (cDefdata) + 'MyDB'
"43fan" <sleap13@xxxxxxxxxxxx> wrote in message
news:3-ydnQR2O68wYsTZnZ2dnUVZ_vudnZ2d@xxxxxxxxxxxxxxxxx
I'm still confused Dan. I'm trying to use the command like the
example shows, like this.
CREATE SQL VIEW myview AS SELECT * FROM alignmentdatabase;
WHERE vehicle = "137"
I get an error message stating no database is open or no current
database.
"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:u9korOvbGHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
You need a DBC to store the view itself, but you can use free
tables in the
view with no problem.
Your description of your situation is standing on a table, waiving
its arms,
and screaming PARAMETERIZED VIEWS!
You'll be surprised how much code you have to delete to make it
work, too.
<g>
Dan
43fan wrote:
Dan,
This would require using VFP databases, correct? I'm using free
tables(.dbf) that are currently running in a FPD2.6 environment.
Shawn
"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:uqEeeftbGHA.3872@xxxxxxxxxxxxxxxxxxxxxxx
See the help topic "Limiting the Scope of a View", and everything
related to
CREATE SQL VIEW.
Dan
43fan wrote:
Thanks Dan, I'll check out the alias possibility. Um...
parameterized view?
"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:ewKP5ksbGHA.4372@xxxxxxxxxxxxxxxxxxxxxxx
1. Sounds like you've got the grid bound to the wrong alias.
If it isn't bound, it'll use whatever alias is currently
selected.
2. Don't use filters with grids prior to VFP9. Ever. Put one
hand on the desk and slap it with the other. <g> This
situation is absolutely perfect for a parameterized view.
Dan
43fan wrote:
VFP 8. Have a grid that's populated from a table(free table).
Initial form asks for user to input a vehicle number, then it
does a seek in the vehicle db and displays description, etc.
User can then click a button to display alignment data for
this vehicle. I have the dbf open in the data environment,
and have a filter set to filter the records to the vehicle
number the user entered. When I click on the button and pull
up the form with the grid on it, I get a list of records, all
for that particular vehicle, but, I'm getting just a list of
multiple records that are exactly the same. For the one
vehicle I'm using to test this with, I should have approx. 10
records, all different of course. That's not what I'm seeing
though, I'm seeing about 30 records, all exactly the same.
Any help? I'm sure it's something simple, but I'm very
inexperienced with VFP.
Thanks!
.
- Follow-Ups:
- Re: Grids... simple, but I don't know...
- From: 43fan
- Re: Grids... simple, but I don't know...
- References:
- Grids... simple, but I don't know...
- From: 43fan
- Re: Grids... simple, but I don't know...
- From: Dan Freeman
- Re: Grids... simple, but I don't know...
- From: 43fan
- Re: Grids... simple, but I don't know...
- From: Dan Freeman
- Re: Grids... simple, but I don't know...
- From: 43fan
- Re: Grids... simple, but I don't know...
- From: Dan Freeman
- Re: Grids... simple, but I don't know...
- From: 43fan
- Re: Grids... simple, but I don't know...
- From: JWB
- Re: Grids... simple, but I don't know...
- From: 43fan
- Re: Grids... simple, but I don't know...
- From: Dan Freeman
- Grids... simple, but I don't know...
- Prev by Date: Re: Creating graphic JPG from VFP6 using GDI+
- Next by Date: Re: Grids... simple, but I don't know...
- Previous by thread: Re: Grids... simple, but I don't know...
- Next by thread: Re: Grids... simple, but I don't know...
- Index(es):