Initializing RDO 
Author Message
 Initializing RDO

I'm wondering if there is any way you can initialize the rdo object.
Here's what I'm trying to do.
I have an existing application.  If I want to add a new record I do a query
that I know will return a resultset with no records.  For e.g.  SELECT *
FROM TABLE WHER Primary_Key_Id = -1
I'm wondering if I really need to do this before adding a new record.  The
query above takes long because it goes through all the records to see if
they match.  Is there a way I could just initialize this rdo and just add?
Thanks in advance.

Simon



Fri, 10 Mar 2000 03:00:00 GMT  
 Initializing RDO

I don't know why you are doing the query (unless you don't have an
rdoResultSet open), you should just be able to use "rdoResultSet.AddNew"
and "rdoResultset.Update". You do have to have established some sort of
connection to the database, but you could use an "INSERT INTO..." query
instead of manipulating a resultset.

--
Larry Stall
Senior Engineer, Controls
Giddings & Lewis, Inc.
MS Site Builder Level II
http://www.ticon.net/~lstall/



Quote:
> I'm wondering if there is any way you can initialize the rdo object.
> Here's what I'm trying to do.
> I have an existing application.  If I want to add a new record I do a
query
> that I know will return a resultset with no records.  For e.g.  SELECT *
> FROM TABLE WHER Primary_Key_Id = -1
> I'm wondering if I really need to do this before adding a new record.
The
> query above takes long because it goes through all the records to see if
> they match.  Is there a way I could just initialize this rdo and just
add?
> Thanks in advance.

> Simon



Fri, 10 Mar 2000 03:00:00 GMT  
 Initializing RDO

Larry,

        Thanks for taking time to help with my question.  So it seems to me that
there is no way for me to inset a new row  when the rdoResultSet is not
open unless I use the INSERT INTO statement.  Only reason why I'm doing the
query is because the rdoResultset is not open.  By doing this I return a 0
row resultset and use .AddNew method to insert a new row.  I guess I have
to use INSERT INTO statement.  Thanks for your insight.  

Simon



Quote:
> I don't know why you are doing the query (unless you don't have an
> rdoResultSet open), you should just be able to use "rdoResultSet.AddNew"
> and "rdoResultset.Update". You do have to have established some sort of
> connection to the database, but you could use an "INSERT INTO..." query
> instead of manipulating a resultset.



Sat, 11 Mar 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. RDO Error 429 - Like to confirm if RDO available from VB Prof

2. RDO 1 -> RDO 2 Problem

3. RDO Error 429 - Like to confirm if RDO available from VB Prof

4. Declaring&initializing variables

5. Initializing public constant array

6. Initializing an array in a module

7. Initializing a combo box from code

8. How to tell is an object has been initialized

9. Better method of detecting static array initialized?

10. Initialize Autonumber

11. Re-Initialize Access7.0-ODBC-Connection to SQL-Server

12. Unable to initialize DAO/Jet db engine

 

 
Powered by phpBB® Forum Software