Ask a Question related to ASP Database, Design and Development.
-
Jeremy #1
moving from one table to another using asp [with errors]
I am having trouble moving a record from one table to another. I keep
getting the following error:
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "rs('Photo') & ', ' &"]'
/photogallery/adminupdate.asp, line 27
I've included my code. Anyone know what this error means & how to go
about remedying it? I'd appreciate any response!
Thanks in advance!
Jeremy
<% LANGUAGE="VBScript"
const adOpenDynamic = 2
const adLockOptimistic = 3
dim sqt
'capture form elements
accept = Request.form("accept")
feature = Request.form("feature")
key = Request.form("key")
'open database and get the record based upon the key
set conn = server.createobject("ADODB.Connection")
conn.Open("DSN=photo")
sqlText = "SELECT * FROM Table1 WHERE Photo = '" & key & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sqlText, conn, adLockOptimistic, adOpenDynamic
'make updates in the record
rs("Accept") = accept
rs("Feature") = feature
rs.Update
' if not accepted delete - if accepted copy to other table then delete
if rs("Accept") = "False" then
rs.delete
else
Set sqt = rs("Photo") & ", " & rs("Unm") & ", " & rs("IID") & ", " &
rs("Title") & ", " & rs("Species") & ", " & _
rs("Gender") & ", " & rs("PerchFly") & ", " & rs("Country") & ", " &
rs("Region") & ", " & rs("Description") & ", " & _
rs("Keywords") & ", " & rs("Feature") & ", " & rs("Entered") & ", "
& rs("Accept")"
Set sqlText = "INSERT INTO Table2 (" & sqt & _
")"
rs.Open sqlText, conn
rs.delete
End if
rs.close
conn.close
Response.Write "Record Updated"
Response.Redirect "adminscreen.asp"
%>
Jeremy Guest
-
#39657 [NEW]: The extended table-specification "database.table" creates errors
From: w dot kaiser at fortune dot de Operating system: XP Pro PHP version: 4.4.4 PHP Bug Type: MySQL related Bug... -
#39657 [Opn]: The extended table-specification "database.table" creates errors
ID: 39657 User updated by: w dot kaiser at fortune dot de Reported By: w dot kaiser at fortune dot de Status: Open... -
Moving Randomly Moving Sprite To New Location on mouseEnter
Hi All, This is way over my head. I am currently using Director 8. I have a randomly moving sprite(call it X) on stage (I accomplished this... -
supress errors at the page level? Undefined index errors.
I'm creating a simple reply form, and if a form item isn't answered I get an error: "Notice: Undefined index: rb_amntspent in... -
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table.
We are getting this error after clearing the web.config of database infomation - even after using the wizard to re-enter the information. I could... -
David C. Holley #2
Re: moving from one table to another using asp [with errors]
What do you mean by 'moving a record' and why do you want to 'move' it?
David H
Jeremy wrote:> I am having trouble moving a record from one table to another. I keep
> getting the following error:
>
> Microsoft VBScript runtime error '800a01a8'
> Object required: '[string: "rs('Photo') & ', ' &"]'
> /photogallery/adminupdate.asp, line 27
>
> I've included my code. Anyone know what this error means & how to go
> about remedying it? I'd appreciate any response!
>
> Thanks in advance!
>
> Jeremy
>
> <% LANGUAGE="VBScript"
> const adOpenDynamic = 2
> const adLockOptimistic = 3
>
> dim sqt
>
> 'capture form elements
> accept = Request.form("accept")
> feature = Request.form("feature")
> key = Request.form("key")
>
> 'open database and get the record based upon the key
> set conn = server.createobject("ADODB.Connection")
> conn.Open("DSN=photo")
> sqlText = "SELECT * FROM Table1 WHERE Photo = '" & key & "'"
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open sqlText, conn, adLockOptimistic, adOpenDynamic
>
> 'make updates in the record
> rs("Accept") = accept
> rs("Feature") = feature
> rs.Update
>
> ' if not accepted delete - if accepted copy to other table then delete
> if rs("Accept") = "False" then
> rs.delete
> else
> Set sqt = rs("Photo") & ", " & rs("Unm") & ", " & rs("IID") & ", " &
> rs("Title") & ", " & rs("Species") & ", " & _
> rs("Gender") & ", " & rs("PerchFly") & ", " & rs("Country") & ", " &
> rs("Region") & ", " & rs("Description") & ", " & _
> rs("Keywords") & ", " & rs("Feature") & ", " & rs("Entered") & ", "
> & rs("Accept")"
>
> Set sqlText = "INSERT INTO Table2 (" & sqt & _
> ")"
> rs.Open sqlText, conn
> rs.delete
> End if
>
> rs.close
> conn.close
> Response.Write "Record Updated"
> Response.Redirect "adminscreen.asp"
>
> %>David C. Holley Guest
-
Aaron [SQL Server MVP] #3
Re: moving from one table to another using asp [with errors]
> Set sqt = rs("Photo") & ", " & rs("Unm") & ", " & rs("IID") & ", " &
....Don't use SET to create strings!!!> Set sqlText = "INSERT INTO Table2 (" & sqt & _
[url]http://www.aspfaq.com/2283[/url]
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Aaron [SQL Server MVP] Guest



Reply With Quote

