|
-
Sep 18th, 2009, 02:29 AM
#3
Thread Starter
Addicted Member
Re: .execute vs .open
 Originally Posted by RunsWithScissors
You might tend to use Execute to, well, EXECUTE and action query that does not return any record, for example, an INSERT.
You would tend to use rs.Open to open a recordset and iterate through the records.
Depending upon the technolgy you are asking about (ADODB or DAO?), there is some overlap.
With ADODB, you could use either method for either purpose. However, I believe INSERTS and UPDATES are performed more efficiently using Execute. You can do them using rs.Open "INSERT INTO . . . Etc" but it is often easier and more efficient to use a command. You can look up the proper sytax in the product documentation (I am rusty on the use of Command in ADO, and I tend to AVOID DAO altogether . . .).
That said, it would be very helpful if you could tell us:
A. What database are you using (Access? SQL Server?)
B. What technology are you using? (ADODB, DAO?)
C. If you ARE using DAO, STOP it , and move to ADODB.
;-)
I wil try to check this thread tomorrow. I am actually pretty good with ADODB, but haven't used it in a while, since migrating to .NET.
So means if I only want insert or update a record, prefer use EXECUTE. If want retrieve records, use OPEN, am I right?
A. Mainly SQL Server now.
B. ADODB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|