HELP!: "Property RecordCount not found" 
Author Message
 HELP!: "Property RecordCount not found"

Quote:

>I'm a relatively new VB programmer and would appreciate the help of any
>of you seasoned Access / database programmers out there.

>I have been getting the "Property 'RecordCount' not found" at the line
>indicated by the **, this occurs in the Sub Form_Load() procedure:

>    Set Db = OpenDatabase(PATHNAME & "\nnpce.mdb")
>    Set GeneTb = Db.OpenTable("Project")
>    Set ItemTb = Db.OpenTable("Items")
>    Set ItemDetTb = Db.OpenTable("ItemDetail")
>**  ProjectCount = GeneTb.RecordCount  

>The following code declares the objects in the code module:
>       Global Db As Database, GeneTb As Table, ItemTb As Table, >>
>               >>ItemDetTb As Table

>It worked fine for a while, then it quit working, and I didn't change a
>thing in the Form_Load procedure.  Any hints?

>Thanks!

>Gene Grant

In order for this to be accurate you would normally execute a
movelast on the recordset, immediately before obtaining
recordcount. If the count is not available projectcount should be
-1 (attached tables gives this according to access help). I suggest
you try this and if it still fails look at your db and tables to
make sure that they are being opened and that records are present
etc. You could try using an sql select count(*) as projectcount
from genetb;

HTH

Lyndon



Thu, 25 Jun 1998 03:00:00 GMT  
 HELP!: "Property RecordCount not found"
lets see.

It sounds like you  are trying to do this with DAO.  I do not
know much about DAO but I do know quite a bit about RDO
(basically the same thing).  If I were to do what you just
described using RDO methods I think i would get the same error.
This is because you can not get the rowcount of a
'Forward-only' result set.  So  I would recommend that you
check to see what type of table is the default table.  If the
property is anything like a forward-only table then this is
your problem

Mike Porter



Fri, 26 Jun 1998 03:00:00 GMT  
 HELP!: "Property RecordCount not found"

Quote:
>I have been getting the "Property 'RecordCount' not found" at the line
>indicated by the **, this occurs in the Sub Form_Load() procedure:

>    Set Db = OpenDatabase(PATHNAME & "\nnpce.mdb")
>    Set GeneTb = Db.OpenTable("Project")
>    Set ItemTb = Db.OpenTable("Items")
>    Set ItemDetTb = Db.OpenTable("ItemDetail")
>**  ProjectCount = GeneTb.RecordCount  

You need to do a MoveLast before getting the recordcount property from a
recordset.

ergo:

        dim db as database, rs as recordset

        set db=dbengine.workspaces(0).databases(0)
        set rs=db.openrecordset("MyTableName", DB_OPEN_TABLE)

        rs.movelast
        variable=rs.recordcount

        rs.close
        db.close

HTH,
Dan McGarry.



Fri, 26 Jun 1998 03:00:00 GMT  
 HELP!: "Property RecordCount not found"
Fixed it!  Turned out to be a buggy little problem with an SQL statement
in another procedure.  The SQL was actually formatted correctly, but when
I commented it out, the program ran again. I moved the SQL into another
procedure and now everything works fine again.  I think this was one of
those mystical VB parsing errors that can occur when VB compiles code, as
the code didn't make it past the compile with this supposed "error."  If
anyone else has seen anything like this, I'd be interested in hearing
about it.

Thanks,

Gene Grant



Sun, 28 Jun 1998 03:00:00 GMT  
 HELP!: "Property RecordCount not found"

Quote:
>I have been getting the "Property 'RecordCount' not found" at the line
>indicated by the **, this occurs in the Sub Form_Load() procedure:
>    Set Db = OpenDatabase(PATHNAME & "\nnpce.mdb")
>    Set GeneTb = Db.OpenTable("Project")
>    Set ItemTb = Db.OpenTable("Items")
>    Set ItemDetTb = Db.OpenTable("ItemDetail")
>**  ProjectCount = GeneTb.RecordCount      

Just use
ProjectCount = GeneTb.RECORDSET.RecordCount

I hope this works

Bye

Michael A. Schulte



Fri, 03 Jul 1998 03:00:00 GMT  
 HELP!: "Property RecordCount not found"

Quote:
> I think this was one of
>those mystical VB parsing errors that can occur when VB compiles code, as
>the code didn't make it past the compile with this supposed "error."  If
>anyone else has seen anything like this, I'd be interested in hearing
>about it.

>Thanks,

>Gene Grant

I had many strange problems with valid references to fields not being
accepted. I had a global table, which was referenced from many many
modules with no problem. Then I changed a piece of totally unassociated
code, and it complained about things like EOF invalid, or mytable("FIELD")
gave - "data type is not an array") as if it had forgot what type the
variable was.

I added a few more lines of code (elsewhere) and the problem disappeared,
or re-appeared in a totally different module. It was really getting things
screwed up.

In the end I tried it on VB4 (16 bit) and it worked fine. (Except for the
BIG performance hit - plus all the new buggy controls).

Robert Griffiths



Sat, 04 Jul 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. HELP!: "Property RecordCount not found"

2. help - "property or method not supported"

3. ODBC error - "file not found" Help

4. help - "data source name not found"

5. help - "data source name not found"

6. ODBC error - "File not found" - Help

7. Help please: "File not found"

8. "module not found"

9. "Module not found" error

10. "Module not found" error

11. "Module Not Found" again

12. "Project Not Found" Error

 

 
Powered by phpBB® Forum Software