What's the difference between these two part o

Results 1 to 5 of 5

Thread: What's the difference between these two part o

  1. #1
    Roel Guest

    Default What's the difference between these two part o

    Can someone please tell me what&#039s the difference between these two parts of code and than in particular for the use of the RECORDSET<BR><BR>First part<BR><BR>Dim objRecordset<BR>Dim strSQL<BR>.....<BR>Set objRecordset = Server.CreateObject("ADODB.Recordset") <BR>strSQL = "SELECT customername FROM customer" <BR>objRecordset.open strSQL, objConnection<BR>......<BR>objRecordset.Close<BR>S et objRecordset = Nothing<BR><BR><BR>Second part<BR><BR>Dim objRecordset<BR>Dim strSQL<BR>......<BR>strSQL = "SELECT customername FROM customer"<BR>Set objRecordset = objConnection.Execute(strSQL)<BR>......<BR><BR><BR >Thank you<BR><BR>Roel

  2. #2
    Join Date
    Dec 1969
    Posts
    572

    Default RE: What's the difference between these two pa

    I don&#039t think there is any difference. You can go either way.<BR>If you have global connection, you would want to go second way. If you need to make new connection on the fly every time, then you go first way.

  3. #3
    Join Date
    Dec 1969
    Posts
    7

    Default RE: What's the difference between these two pa

    In your second example, you wouldn&#039t be able to use some of the ADODB methods like AbsolutePage, AbsolutePosition, etc. on the recordset.<BR><BR>Yvette

  4. #4
    manoj Guest

    Default RE: What's the difference between these two pa

    in the second part u are calling a<BR>command string to execute the code<BR>well there is not much difference in <BR>the code, the second part is more useful<BR>when u have a stored procudure to run<BR>then u can call that stored procedure <BR>and execute that command string


  5. #5
    Join Date
    Dec 1969
    Posts
    52

    Default RE: What's the difference between these two pa

    What&#039s global connection? You mean making the recordset a global variable?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •