|
 |
asp_databases thread: Can someone check to see if my code are the right syntax?
Message #1 by fione0212@h... on Wed, 15 Aug 2001 18:00:59
|
|
Dear Expert,
I'm wondering if you can check if my syntax are right, I keep getting this
error
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'write'
/orgchart1/display_form.asp, line 27
which annoys me a lot. Everything has been working fine until this error.
Thanks!!
Regards,
Vicky
Here is my code
<%@ Language=VBScript %>
<%Option Explicit
Response.Expires = 0 %>
<!--#include file ="ADOFunctions_inc.asp"-->
<html>
<head>
<meta http-equiv="pragma" Content="no-cache">
<title>Welcome to Watershed's Org Chart!!</title>
</head>
<body background="../images/stars.jpg">
<LINK rel="stylesheet" type="text/css" href="../html.css">
<%
Dim objRecordset
Dim varSQL
Dim varEmpno
varSQL = "SELECT empno, ename_last," & _
" ename_first, phone, " & _
" location, title,expertise,
job_description " & _
"FROM crw_employees "
Set objRecordset = GetDBConnection().Execute(varSQL)
Do While Not objRecordset.EOF
varEmpno = objRecordset.Fields("empno")
Response.write "<TABLE BORDER=1><tr> " & _
" <td WIDTH=151
HEIGHT=250>picture not available yet</td>"& _
" <td WIDTH=15
HEIGHT=250></td> " & _
" <td WIDTH=210
HEIGHT=250><B>Name:</b>" & objRecordset("ename_last"), ("ename_first")
& "<P>" & _
"<b>Phone:</b>" &
objRecordset("phone") & "<P>" & _
"<b>Location:</b>" &
objRecordset("location") & "<P>" & _
"<b>Title: </b>" &
objRecordset("title") & "<P> </td>" & _
"</tr></table> <P>" & _
"Expertise:<p>" & objRecordset
("expertise") & "<P>" & _
"Job Description:<P>" & objRecordset
("job_description") & "<P>" & _
objRecordset.Movenext
Loop
set objRecordset = nothing
%>
</body>
</html>
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 16 Aug 2001 11:08:28 +1000
|
|
You have a line continuation character on this line:
: ("job_description") & "<P>" & _
and so it's adding:
: objRecordset.Movenext
giving you:
Response.Write(... & "<P>" & objRecordset.Movenext)
which isn't valid syntax, hence the error. You need to remove that last line
continuation character.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <fione0212@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, August 15, 2001 6:00 PM
Subject: [asp_databases] Can someone check to see if my code are the right
syntax?
: Dear Expert,
:
: I'm wondering if you can check if my syntax are right, I keep getting this
: error
:
:
:
: Microsoft VBScript runtime error '800a01c2'
:
: Wrong number of arguments or invalid property assignment: 'write'
:
: /orgchart1/display_form.asp, line 27
:
:
: which annoys me a lot. Everything has been working fine until this error.
:
: Thanks!!
:
: Regards,
:
: Vicky
:
: Here is my code
:
:
:
:
: <%@ Language=VBScript %>
: <%Option Explicit
: Response.Expires = 0 %>
: <!--#include file ="ADOFunctions_inc.asp"-->
: <html>
: <head>
: <meta http-equiv="pragma" Content="no-cache">
: <title>Welcome to Watershed's Org Chart!!</title>
: </head>
: <body background="../images/stars.jpg">
: <LINK rel="stylesheet" type="text/css" href="../html.css">
: <%
: Dim objRecordset
: Dim varSQL
: Dim varEmpno
:
: varSQL = "SELECT empno, ename_last," & _
: " ename_first, phone, " & _
: " location, title,expertise,
: job_description " & _
: "FROM crw_employees "
:
: Set objRecordset = GetDBConnection().Execute(varSQL)
:
: Do While Not objRecordset.EOF
: varEmpno = objRecordset.Fields("empno")
:
: Response.write "<TABLE BORDER=1><tr> " & _
: " <td WIDTH=151
: HEIGHT=250>picture not available yet</td>"& _
: " <td WIDTH=15
: HEIGHT=250></td> " & _
: " <td WIDTH=210
: HEIGHT=250><B>Name:</b>" & objRecordset("ename_last"), ("ename_first")
: & "<P>" & _
: "<b>Phone:</b>" &
: objRecordset("phone") & "<P>" & _
: "<b>Location:</b>" &
: objRecordset("location") & "<P>" & _
: "<b>Title: </b>" &
: objRecordset("title") & "<P> </td>" & _
: "</tr></table> <P>" & _
: "Expertise:<p>" & objRecordset
: ("expertise") & "<P>" & _
: "Job Description:<P>" & objRecordset
: ("job_description") & "<P>" & _
:
: objRecordset.Movenext
: Loop
: set objRecordset = nothing
: %>
: </body>
: </html>
:
: ---
: * Fast, Full-Featured Microsoft® Excel Web Reports & Charts!
: A breakthrough in high performance Web application development,
SoftArtisans
: ExcelWriter 1.1 supports native Excel charting, image insertion, and
: advanced functions & formatting. One click generates presentation-quality
: Excel spreadsheets-and ExcelWriter performs over 100 times faster than the
: Excel Object. Several editions, including ExcelWriterFREE, are available.
: http://www.softartisans.com/softartisans/excelwriter.html>
$subst('Email.Unsub')
Message #3 by "Tomm Matthis" <matthis@b...> on Fri, 17 Aug 2001 06:42:13 -0400
|
|
Here' your problem:
> HEIGHT=250><B>Name:</b>" & objRecordset("ename_last"), ("ename_first")
You forgot to preface the field with objRecordset
-- Tomm
> -----Original Message-----
> From: fione0212@h... [mailto:fione0212@h...]
> Sent: Wednesday, August 15, 2001 6:01 PM
> To: ASP Databases
> Subject: [asp_databases] Can someone check to see if my code are the
> right syntax?
>
>
> Dear Expert,
>
> I'm wondering if you can check if my syntax are right, I keep
> getting this
> error
>
> [snip!]
|
|
 |