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

Checking to see if record exsists BEST WAY?

Status
Not open for further replies.

Ktx7ca

IS-IT--Management
Apr 5, 2008
88
CA
HI everyone

I have a split Database in access2003 I'm working on with 3 to 5 users. The table I'm working with has around 350,000 records in it.

I want to check if a record exsists.and give a message or run some code either way. I don't want to display the info at this point just know if it's there.

Each user would be checking if some record exsists every few seconds.

what going to be the best way to do this for ease and speed over the network

1)Check the recordcount of a query?

2)Do a Dlookup (I think this would be slow) ?

3)Open a database or recordset in code ?

4)Or some better way that I havn't though of?

Any thoughts and implementation Ideas Welcome

Thanks Chris



 
I figured the problem was there as well , there's just the botton with the code and that text box on the form. I moved it around tried different boxs and location/forms And such but always the same result and it's drivving me crazy
 
JoeAtWork . . .

Just a quickie!
JoeAtWork said:
[blue][purple]Also I note in the same quote that they claim that RecordCount will be zero[/purple], which I know from experience will not always be true. So if they are incorrect about one property.....[/blue]
If you go back and check, you'll see that the [blue]RecordCount will be zero[/blue] is [purple]stipulated for an empty recordset![/purple]

Recordcount (if you need to use it) has a problem with large recordsets, as it appears the code is running asynchronsis with loading of the data. Thats why [blue]movelast[/blue] is required in this way. It appears to synchronize loading of the recordset data, and the code waits until the last record is loaded.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
I'm pretty sure I've seen RecordCount return -1 even when the recordset was populated.

 
The Recordcount property in ADO is, in part, a function of the CursorType that you specify
ADO Documentation said:
The cursor type of the Recordset object affects whether the number of records can be determined. The RecordCount property will return -1 for a forward-only cursor, the actual count for a static or keyset cursor, and either -1 or the actual count, depending on the data source, for a dynamic cursor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top