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

Recordset or Connection 1

Status
Not open for further replies.

ITGL72

MIS
Jul 2, 2001
105
US
I'm a beginning ASP programmer. Last 2 years I have used basic cold fusion and now need to get my hands dirty with ASP.

I'm a little confused as to when to use:

Set Catalog=Server.CreateObject("ADODB.Connection")

vs

Set Catalog=Server.CreateObject("ADODB.Recordset")




Can someone give me the low down laymens term on when to use each one?





SO FAR -- seems like ASP is more diffcult to use then cold fusion. But its only been a few weeks.
 
Alot of it depends on how you want to handle whatever data is coming back.

Ideally, you don't create a recordset object unless you are obtaining data back from the database.

i.e.

Insert into table set field1=a, field2=b;

Becuase this statment doesn't require data back from the database, then you would use just connection object
(server.createobject("adodb.connection"))

But if you are using a select statement then you would need a recordset object to hold the values obtained back from the database. The connection object can't do that for you.

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top