Results 1 to 4 of 4

Thread: CreateObject

  1. #1
    Tink Guest

    Default CreateObject

    Set Conn = Server.CreateObject("ADODB.Connection")<BR>cDStr = "DRIVER={Microsoft Access Driver (*.mdb)};"<BR>cDStr = cDStr & "DBQ=" & Server.MapPath("db/test.mdb") & ";"<BR>Conn.Open(cDStr)<BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>Set RS2 = Server.CreateObject("ADODB.Recordset") <BR><BR>In this line of code, does the 2 RS will have no conflict with each other because they are both needed to compute a data that&#039;s within a same Database but in a different table?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: CreateObject

    They won&#039;t interfere with each other. It is quite safe to have two (or more) instances of one object on one page.<BR><BR>Craig.

  3. #3
    deep_jeff Guest

    Default Not advanced!

    That isn&#039;t advanced! I think!

  4. #4
    Join Date
    Dec 1969

    Default I think it fits...

    ...the criteria. He didn&#039;t ask if he could *do* that (he obviously already has). He asked if the two recordsets would interfere. And, actually, they *could*!<BR><BR>For example, if you are adding records to a table via one RS and reading that same table (possibly via a JOIN, even!) in the other RS, then the "dependent" RS could be affected, depending upon the cursor type in use on the two.<BR><BR>And even if it *looks* like the two RS objects refer to independent tables, it is possible that there is a "Trigger" or other event handler in use on that DB whereby adding or changing a record in the one table could alter the other. <BR><BR>So there&#039;s no clearcut answer here. <BR><BR>ADO won&#039;t do anything to make the two interfere, directly, but your choice of cursor type and locking type and the internals of the DB design could.<BR><BR>

Posting Permissions

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