473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Cannot figure out where is the problem with code to add row

Hi,
I have the following code which addes a publisher to the publishers table in
the pubs database. However, for some reason, I am getting the following error:

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'CreateParameters'
/beginaspdatabase1/ProfASP_AddPublisher.asp, line 40 The line 40 is the
first instance of the createparameter statement.

CODE:

<!-- #INCLUDE FILE="Connection1.asp" -->
<!-- #include file="adovbs.inc" -->
<HTML>
<HEAD>
</HEAD>
<BODY>

<%
Dim cmdPublisher, returnvalue, lngrecs

set cmdPublisher = server.CreateObject("ADODB.Command")

'Dim pub_id, pub_name, pub_city, pub_state, pub_country

'pub_id = Request.Form("txtPubID")
'Response.Write pub_id & "<br>"

'pub_name = Request.Form("txtPubName")
'Response.Write pub_name & "<br>"

'pub_city = Request.Form("txtPubCity")
'Response.Write pub_city & "<br>"

'pub_state = Request.Form("txtPubState")
'Response.Write pub_state & "<br>"

'pub_country = Request.Form("txtPubCountry")
'Response.write pub_country & "<br>"

'Response.End
With cmdPublisher
.ActiveConnection = objConn
.CommandText = "proc_insertpublisher"
.CommandType = adCmdStoredProc

'Create the parameters

.Parameters.Append .CreateParameters ("returnvalue", adInteger,
adParamReturnValue)
.Parameters.Append .CreateParameters ("pub_id", adChar, adParamInput, 4)
.Parameters.Append .CreateParameters ("pub_name", adVarWChar,
adParamInput, 40)
.Parameters.Append .CreateParameters ("pub_city", adVarWChar,
adParamInput, 20)
.Parameters.Append .CreateParameters ("pub_state", adChar, adParamInput, 2)
.Parameters.Append .CreateParameters ("pub_country", adVarWChar,
adParamInput, 30)

'Now set the parameter values
.Parameters("pub_id") = Request.Form("txtPubID") 'Here it is to be noted
that the Parameter(0) is reserved for return value
.Parameters("pub_name") = Request.Form("txtPubName")
.Parameters("pub_city") = Request.Form("txtPubCity")
.Parameters("pub_state") = Request.Form("txtPubState")
.Parameters("pub_country") = Request.Form("txtPubCountry")

'Run the stored procedure

cmd.Execute lngRecs, ,adExecuteNoRecords
'Now extract the return value
lngAdded = .Parameters("returnvalue")
end with
%>

</BODY>
</HTML>

I would appreciate any insgiht to the problem. Thanks.
Jan 3 '06 #1
3 1609
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
Hi,
I have the following code which addes a publisher to the publishers table
in
the pubs database. However, for some reason, I am getting the following
error:

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'CreateParameters'
/beginaspdatabase1/ProfASP_AddPublisher.asp, line 40 The line 40 is the
first instance of the createparameter statement.

[snip]

The method name is CreateParameter, not CreateParameters. Singular, not
plural.
Jan 4 '06 #2
Thanks Chris for pointing out the error. It was small yet valuable to me.
With the suggested change the code works fine. Best regards.
"Chris Hohmann" wrote:
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
Hi,
I have the following code which addes a publisher to the publishers table
in
the pubs database. However, for some reason, I am getting the following
error:

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'CreateParameters'
/beginaspdatabase1/ProfASP_AddPublisher.asp, line 40 The line 40 is the
first instance of the createparameter statement.

[snip]

The method name is CreateParameter, not CreateParameters. Singular, not
plural.

Jan 4 '06 #3
You might want to try out my stored procedure code generator available at
http://www.thrasherwebdesign.com/ind...asp&c=&a=clear

Jack wrote:
Thanks Chris for pointing out the error. It was small yet valuable to
me. With the suggested change the code works fine. Best regards.
"Chris Hohmann" wrote:
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
Hi,
I have the following code which addes a publisher to the publishers
table in
the pubs database. However, for some reason, I am getting the
following error:

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'CreateParameters'
/beginaspdatabase1/ProfASP_AddPublisher.asp, line 40 The line 40 is
the first instance of the createparameter statement.

[snip]

The method name is CreateParameter, not CreateParameters. Singular,
not plural.


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jan 4 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: rathnesh | last post by:
when using a web application which includes taking an asp page then going to another asp page and coming back to first page ...some times connection to iis gets terminated and page canot be...
7
by: George Jordanov Ivanov | last post by:
Folks, I have to design the WSDL files of a bunch of XML Web Services. But, unfortunately, I am not very keen on writing the WSDL file line by line, and moreover be aware of the whole standard...
7
by: Mathew Butler | last post by:
I'm investigating an issue I have when pulling data back from MS access I'm retrieving all rows from a column in a table of 5000 rows - accessing a column of type "memo" ( can be 65353 character...
2
by: JRamirez | last post by:
Need help cannot figure out where I made the error. -------------------------------------------------------------------------------- Can someone view what I have, I need help I cannot figure out...
2
by: =?Utf-8?B?cmVk?= | last post by:
Hi Friends, We recently deployed our application to production and I am experiencing the below error message. Cannot access a disposed object named "System.Net.TlsStream" The error occurs...
2
by: leeperman | last post by:
In Dreaweaver I cannot filter my database results to display only specific data that is retrieved from mulptile drop down list on my search page. The drop down list selections are posted to my...
17
by: fl | last post by:
Hi, I am learning C++ from the following C++ website, which has some very good small examples. For the second Fraction example, which has five files: Main.cpp Fraction.cpp Fraction.h...
7
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and...
4
by: gerardianlewis | last post by:
Any help appreciated. (VB.NET under XP and Vista, SP1 installed) My code, inherited from a VB6 version of an app that ran under W98, loads an image from a file into a PictureBox. The user may...
4
by: Ken Foskey | last post by:
I am getting more and more frustrated with this. foreach (DataGridViewRow row in venuesDataGridView.Rows) { myDataSet.VenuesRow data = (myDataSet.VenuesRow)((DataRowView)...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.