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!

Adding records; ADO or SQL? 1

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
Do either of these methods offer better performance over the other?

ADO:
rs.addnew
rs("field1") = value
rs("field2") = value
rs.update

SQL:
mySQL="INSERT INTO myTable......."
conn.excute mySQL

Is it better to use one over the other in certain circumstances?
 
It has been my experience SQL statements are better to use. With the SQL statement you are not holding open a recordset and therefore using less memory. This is important for scalability.

If performance is important to you as well as scalability, you shouldn't be using ADO from an ASP page. Write a COM object to handle your Database work then call this object from ASP. This is also good programming practice as you are separating the business rules from the user interface. It is sometimes hard to enforce with ASP, but you should really be trying to create your web applications with the Object Oriented design in mind.
 
Are there any good resources online for implementing those suggetions? I am very interested, but my VB skills are..."lacking".

Thanks
 
I'm sure there is but I do not know of one off the top of my head. I suggest going to google.com and doing a search on something like "VB DLL tutorial". You may benefit by doing the same type of search but this time on ADO. You can learn quite a few tips and tricks. If you have access to the MSDN Library, there is extensive documentation on ADO.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top