General discussion

Locked

Find My Error : ASP & VB Script Code

By webmaster ·
Find the error ("Wrong number of arguments or invalid property assignment") on line 17 (denoted by "L17")...
L1 <%@ LANGUAGE="VBSCRIPT" %>
L2 <!--#include virtual="ADOVBS.INC"-->
L3 <HTML>
L4 <BODY>
L5 <%
L6 Dim strQ, strW
L7 Dim objConn, objRS
L8 Dim objCmd, objParam
L9 Dim FirstField

L10 Set objConn = Server.CreateObject("ADODB.Connection")
L11 objConn.Open "SQL Trial Test", "adams2", "darkwood"
L12 strQ = "SELECT * FROM PNote"
L13 FirstField ="iComKey"
L14 sSql = "sp_NextKey '" & FirstField & "'"
L15 strP = objConn.Execute(sSql)
L16 strW = "INSERT INTO PNote (icomkey, ibuskey, crep, cactivity, cproduct, mcomment, lclosed, dcomment, cudf1, cudf2, cudf3) VALUES ('"
L17 strW = strW & strP & "','104','JOHN','Appointment','Other','mupup','26-03-07','1','3','7','7')"
L18 objConn.Execute strW
L19 set objRS = objConn.Execute(strQ)
%>
...code continues to irrelevant sections...

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Find My Error : ASP & VB Script Code

by shadowtraitor In reply to Find My Error : ASP & V ...

hey your in your insert statement you are inserting StrW which is currently holds a string which holds the insert statement.
Another thing is that the date should be enclosed in pound signs # datestring #
it is also not necessary to enclose the the SQL string in braces it is just

set strP = objConn.Execute sSQL
set objRS = objConn.Execute strQ

It probably should be
strW = "INSERT INTO PNote (icomkey, ibuskey, crep, cactivity, cproduct, mcomment, lclosed, dcomment, cudf1, cudf2, cudf3)
VALUES ('" & strP & "','104','JOHN',
'Appointment','Other','mupup','#26-03-07#','1','3','7','7')"

Collapse -

Find My Error : ASP & VB Script Code

by webmaster In reply to Find My Error : ASP & V ...
Collapse -

Find My Error : ASP & VB Script Code

by LyXX In reply to Find My Error : ASP & V ...

In line L17 You try connect strP to line, but it's not a string, you must describe, what field you want like

strP.Fields("Name_of_field") OR if stored procedure returned one result, you can write

strP.Fields(0)

Collapse -

Find My Error : ASP & VB Script Code

by webmaster In reply to Find My Error : ASP & V ...
Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums