The following code works fine on my PC (SQL 7.0) but errors when running on another Machine (with SQL 2000) installed.
The tables should be the same on both machines so what else may be causing this error?
VB Code:
Set Conn = Server.CreateObject("ADODB.Connection") Query = "DECLARE @Email varchar(255) SELECT @Email = (SELECT uemail FROM aamem WHERE ukey = " & IsContactedBy & ") INSERT INTO AAMem (UTitle, UFName, ULastC, UEmail, UCtry, URandomID, UPassword, Visits, UFNameEng, ULastCEng, IsContactedBy) VALUES ('" & UTitle & "','" & UFName & "','" & ULastC & "',@Email,'" & UCtry & "','" & URandomID & "','" & UPassword & "','" & Visits & "','" & UFNameEng & "','" & ULastCEng & "','" & IsContactedBy & "');select @@identity" Conn.Open(Application("ConnectionString")) Set RS = Server.CreateObject("ADODB.RecordSet") Set RS = Conn.Execute (Query).NextRecordset JustInsertedID = RS(0)
NB the error is "Item cannot be found in the collection corresponding to
the requested name or ordinal"
on the
JustInsertedID = RS(0) line




Reply With Quote