Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Update Issue

Author  Topic 

bobbabuoy
Starting Member

33 Posts

Posted - 2005-02-08 : 17:34:05
I am having trouble updating a sql server 2000 recordset from an asp page. I know the sql is good because I use the same one to retrieve the data that I want to update (using an execute method) but I get "Invalid Column Name" for a clearly valid column name when I try to update it using rs.open. Could it be my locks or cursor type?

Here is my code in case there is a brain cramp in there that I am missing:


code:--------------------------------------------------------------------------------
Set rs=Server.CreateObject("ADODB.Recordset")
sql = "SELECT rr.RaceLogRsltsID, rr.FinalTime, rg.RaceDist, rg.RaceType, rg.EventName, rg.EventDate, rg.RaceLogID "
sql = sql & "FROM RaceLog rg INNER JOIN RaceLogRslts rr ON rr.RaceLogID = rg.RaceLogID "
sql = sql & sWHERE & " ORDER BY " & sFinalSort
rs.Open sql, conn, adOpenKeyset, adLockOptimistic
--------------------------------------------------------------------------------


It tells me that the rg.RaceDist is an invalid column name.
Thanks in advance!

cshah1
Constraint Violating Yak Guru

347 Posts

Posted - 2005-02-08 : 17:48:52
Response.Write you SQL statement and post it here
i.e.
rs.Open sql, conn, adOpenKeyset, adLockOptimistic
Response.Write(sql)
Response.End
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-02-09 : 00:15:50
Check whether RaceDist is the column of RaceLog

Madhivanan
Go to Top of Page
   

- Advertisement -