DBGrid--Invalid File Reference 
Author Message
 DBGrid--Invalid File Reference

From time to time I have to take my work home with me (or bring it back
to work), which occasionally involves a project with a DBGrid in it.
When I move from machine to machine I get the following error log:
-----------------------------
Line 118: Property Bindings in DBGrid1 had an invalid file reference.
Line 121: Property OleObjectBlob in DBGrid1 had an invalid file
reference.
Line 117: Cannot load control DBGrid1.
----------------------------

And of course the project loads without the grid, which I may have spent
a lot of time configuring.  The grid is registered on both machines, so
what kind of "file references" could possibly become invalid simply by
copying my project files from one machine to the next? This is annoying
(although it does give me lots of practice setting up my grid!) What
should I be doing to prevent this?

Anthony Glass



Wed, 20 Mar 2002 03:00:00 GMT  
 DBGrid--Invalid File Reference

Quote:

> From time to time I have to take my work home with me (or bring it back
> to work), which occasionally involves a project with a DBGrid in it.
> When I move from machine to machine I get the following error log:
> -----------------------------
> Line 118: Property Bindings in DBGrid1 had an invalid file reference.
> Line 121: Property OleObjectBlob in DBGrid1 had an invalid file
> reference.
> Line 117: Cannot load control DBGrid1.
> ----------------------------

> And of course the project loads without the grid, which I may have spent
> a lot of time configuring.  The grid is registered on both machines, so
> what kind of "file references" could possibly become invalid simply by
> copying my project files from one machine to the next? This is annoying
> (although it does give me lots of practice setting up my grid!) What
> should I be doing to prevent this?

  Just guessing, but "invalid file reference" sounds like VB is having
trouble finding the database to be displayed in the grid.  Is the db at
same path location on both machines?  Is the app installed in same path
location on both?  The OLE error - is the file being OLE'ed at the same
location on both machines?  Those are the things I'd check, vis a vis
all references in the project to paths leading to the grid (via data
control or other recordset).
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Thu, 21 Mar 2002 03:00:00 GMT  
 DBGrid--Invalid File Reference
The dbs are in fact located in different directories on each machine, so that
could be the culprit.  I've had other projects load the grid but not the data
when moving from machine to machine (the DBGrid survival kit files are a
notable example--none of those paths work right out of the box either, but the
grid at least makes an appearance.) so I didn't think to look into that at
first.

Unfortunately, the error logs before I can open the project and change my
database path, so I'll probably have to edit the .frm, or my .bas file (which
is where the database file is actually specified) before I load it next time.

Thanks for the tip,

Anthony Glass

Quote:

>   Just guessing, but "invalid file reference" sounds like VB is having
> trouble finding the database to be displayed in the grid.  Is the db at
> same path location on both machines?  Is the app installed in same path
> location on both?  The OLE error - is the file being OLE'ed at the same
> location on both machines?  Those are the things I'd check, vis a vis
> all references in the project to paths leading to the grid (via data
> control or other recordset).
> --
> Jim in Cleveland
> If you're writing to me, in my address
> change "REAL_Address.see.below" to "worldnet.att.net"

> "What's so funny 'bout peace, love & understanding?"
>      - Nick Lowe



Thu, 21 Mar 2002 03:00:00 GMT  
 DBGrid--Invalid File Reference

Quote:

> The dbs are in fact located in different directories on each machine, so that
> could be the culprit.  I've had other projects load the grid but not the data
> when moving from machine to machine (the DBGrid survival kit files are a
> notable example--none of those paths work right out of the box either, but the
> grid at least makes an appearance.) so I didn't think to look into that at
> first.

> Unfortunately, the error logs before I can open the project and change my
> database path, so I'll probably have to edit the .frm, or my .bas file (which
> is where the database file is actually specified) before I load it next time.

  Another thought - is your form with the grid the first form that loads
when this project starts?  If so, you might want to create a start-up
form that lets you specify db location.
  I did a project where I started with an MDI form and provided a Tools
menu item where user could set the path to the db - some code would save
that path to a one-line txt file written to App.Path.  From then on, at
start up the program could read that txt file to get the correct path to
the db - stow the path info in a string and use that string anywhere in
the program that requires you to state the path to the db.  This also
allowed user to move the db to another folder, and use the Tools item to
re-set the path.  This kind of flexability can come in handy.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Thu, 21 Mar 2002 03:00:00 GMT  
 DBGrid--Invalid File Reference


Quote:
>   Another thought - is your form with the grid the first form that
loads
> when this project starts?  If so, you might want to create a start-up
> form that lets you specify db location.
>   I did a project where I started with an MDI form and provided a
Tools
> menu item where user could set the path to the db - some code would
save
> that path to a one-line txt file written to App.Path.  From then on,
at
> start up the program could read that txt file to get the correct path
to
> the db - stow the path info in a string and use that string anywhere
in
> the program that requires you to state the path to the db.  This also
> allowed user to move the db to another folder, and use the Tools item
to
> re-set the path.  This kind of flexability can come in handy.
> --

Yes--it is in fact the first of two forms (the second is invoked ad
hoc).  I've been meaning to investigate MDI forms more, but I've been
preoccupied with just getting working models up and running for the time
being.  Unfortunately, I'm not finding much in the online help on the
various uses and advantages of MDIs--any suggestions on books that give
a thorough coverage of the subject?

arg

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 22 Mar 2002 03:00:00 GMT  
 DBGrid--Invalid File Reference

Quote:

> Yes--it is in fact the first of two forms (the second is invoked ad
> hoc).  I've been meaning to investigate MDI forms more, but I've been
> preoccupied with just getting working models up and running for the time
> being.  Unfortunately, I'm not finding much in the online help on the
> various uses and advantages of MDIs--any suggestions on books that give
> a thorough coverage of the subject?

  Peter Wright's "Beginning Visual Basic 6" (Wrox Press) gives MDI about
10 pages, which is the most of any book I have (such as the Sams "VB6 in
21 days" and "More VB6 in 21 days").
  The idea I suggested isn't limited to MDI forms, though - my point
was, you need some way to avoid loading the form with your data control
and grid until after you've checked for a valid path to the db file.  A
non-MDI form could do it...or your current form could load with the data
control and grid blank, and user would have to do "something" to fill
the grid - that procedure could check for a valid path.  If you have
multiple forms, though, MDI interface looks pretty professional.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Fri, 22 Mar 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. dbGrid Invalid file reference (property bindings)

2. invalid file reference?

3. invalid file reference?

4. Invalid Reference(s)

5. Problem with invalid reference error

6. 2nd Posting: Invalid Reference Problem

7. Problem with Invalid Reference Error

8. Invalid Reference (Error 13 - Type Mismatch)

9. Invalid reference

10. 2 recordsets gives Invalid Reference error

11. MDI Child Form Reference Invalid

12. GetObject returning invalid reference

 

 
Powered by phpBB® Forum Software