Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 vb6 sql

views
     
TSnxfx
post Feb 14 2006, 02:44 PM, updated 20y ago

Enthusiast
*****
Senior Member
979 posts

Joined: Jan 2003


I'm wondering which is better in term of speed and performance.

SQL$ = " select * myTable where 1=0 "
Set myrecordset= New Recordset
myrecordset.Open RecSource$, MainDb, adOpenStatic, adLockOptimistic
myrecordset.AddNew
myrecordset.Fields("name") = "James"
myrecordset.Update
myrecordset.Close

OR

SQL$ = "INSERT INTO myTable(name) VALUES('James')"
myrecordset.Open SQL$, MainDb, adOpenStatic, adLockOptimistic


Please give views and opinions. Thankx.
TSnxfx
post Feb 15 2006, 08:16 AM

Enthusiast
*****
Senior Member
979 posts

Joined: Jan 2003


For the 1st "select * myTable where 1=0" , would it return the record even if the "where 1=0" which is false?
Other than that I do agree with you.
TSnxfx
post Feb 16 2006, 08:35 AM

Enthusiast
*****
Senior Member
979 posts

Joined: Jan 2003


Oic, thanks for the enlightenment.

 

Change to:
| Lo-Fi Version
0.0119sec    1.56    6 queries    GZIP Disabled
Time is now: 23rd December 2025 - 12:58 PM