Results 1 to 4 of 4

Thread: Recordset

  1. #1
    Sean K. Guest

    Default Recordset

    I am using a standalone recordset to keep track of old and new IDs while I am dumping data from one database to another(this way tables with records that have fields that point to ids of records in other tables won&#039;t get screwed), and am trying to select the new id where the old ID is located, this is what Im using(note: nID is set to the original ID field of the table I am pulling data from):<BR><BR> sSQL = "SELECT newID FROM idKEY WHERE oldID =" & nID & ";" <BR> Set SportID = idKEY.Execute(sSQL)<BR><BR>Now I&#039;m guessing standalone recordsets don&#039;t like this, because It&#039;s giving me the following error:<BR><BR> Microsoft VBScript runtime error &#039;800a01b6&#039; <BR> Object doesn&#039;t support this property or method: &#039;Execute&#039; <BR><BR>Any suggestions as to how I can do this?<BR>

  2. #2
    Sean K. Guest

    Default I'm using Access (n/t)


  3. #3
    Join Date
    Dec 1969

    Default RE: Recordset

    Did you create a recordset object before? becaus the Key word "Set" is actually preaparing the variable to be an object ...well that is maybe not the best explanation but...<BR><BR>So<BR><BR>Dim SportID <BR>Set SportID = Server.CreateObject("ADODB.Recordset")<BR>SportID. Open [source][activeConnection][other parameter] look at the docs.<BR><BR>-----------------------------------------------------------------<BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open [ConnectionString]<BR><BR>Dim strSQL<BR>strSQL = "SELECT newID FROM idKEY WHERE oldID =" & nID & ";"<BR><BR>Dim SportID<BR>Set SportID = Server.CreateObject("ADODB.Recordset")<BR>&#039;No w before opening check if there is an error in the SQL Query<BR>&#039;DEBUG comment when done<BR>Response.Write strSQL & "&#060;hr&#062;"<BR>SportID.Open strSQL, objConn,3,2<BR>Response.Write "OK so far thing are work great &#060;hr&#062;"<BR><BR>&#039;How many records now did my Query Return<BR>Response.Write SportID.RecordCount & "&#060;hr&#062;"

  4. #4
    Sean K. Guest

    Default RE: Recordset

    Yeah I have that Set earlier in the code, thanks for pointing that out. I will implement your suggestion and see what happens

Posting Permissions

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