ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 2nd, 2008, 04:49 AM
Hane Hane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 6 Hane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
Wrong number of arguments or invalid property assignment: 'insert'

I'm new to this. I have a website that I edited dont bother with the java as i dont know it but for some or other reason something must have change as i keep getting this error when I try and load new info on the database.

The error is on (in red):


Code Code:
Original - Code Code
    if request("submit1") = "Submit" then if request("tname") <> "" then session("tname") = request("tname") tablename = request("tname") end if if request("action") = "add" then                ' insert         for myqty = 1 to cint(request("myqty")) if not insert(tablename, lngerr, strmsg, inssql, myqty) then              if session("pagename") = "" then Response.Redirect "admin.asp" else Response.Redirect session("pagename") end if 'Response.Write "Insert failed for tablename " & tablename & " : " & strmsg & " <br><br> sql: " & replace(inssql,VbCrlf,"<br>") & "  <br><br> <a href=# onclick=history.back();>Try again</a>"    'Response.end 'exit for else

If you need more of the script please let me know. Any help would be appreciated.

Reply With Quote
  #2  
Old May 2nd, 2008, 05:03 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 9,962 micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 2 Weeks 4 Days 13 h 54 m 16 sec
Reputation Power: 1275
hi and welcome to the forum
what exactly are you trying to do??

If you are inserting a new record in database then have a look here for syntax
http://www.w3schools.com/SQL/sql_insert.asp
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #3  
Old May 2nd, 2008, 06:06 AM
Hane Hane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 6 Hane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
[QUOTE=micky]hi and welcome to the forum
what exactly are you trying to do??

If you are inserting a new record in database then have a look here for syntax
QUOTE]

Hi and thanks.

This is an existing website that I just edited to fit my new needs. This specific page works with the manager side of the website. It greats the places where you can add other users, other products etc.

Now I didn't bother with this page except to change the file name for the header. As this is in Java and i cant do that yet.

I will post the whole page for you to see

Reply With Quote
  #4  
Old May 2nd, 2008, 06:11 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,831 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 15 h 16 m 28 sec
Reputation Power: 57
In what file does the function/sub insert(...) reside? Have you included that function, or the file that contains it, in your script?
__________________
selwonk

Reply With Quote
  #5  
Old May 2nd, 2008, 06:22 AM
Hane Hane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 6 Hane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
Code Code:
Original - Code Code
    <!--#INCLUDE FILE="../includes/vars.asp"--> <% 'if session("userid") = "" then 'Response.Redirect "default.asp" 'end if if request("id") <> "" then id = cint(request("id")) end if %> <html> <head> <SCRIPT LANGUAGE=javascript> <!-- function docheck2(field1){ if(field1.value.length > 600){ field1.value = field1.value.substring(0, 600); }    } //--> </SCRIPT> <!--#INCLUDE FILE="includes/meta.asp"--> </head> <body bgcolor="FFFFFF" topmargin="0" marginheight="0" leftmargin="0" marginwidth="0" background="/manager/images/bg.gif" LANGUAGE=javascript> <table border="0" cellpadding="0" cellspacing="0" width="780"> <tr> <td valign="top" align="left" colspan="5"> <!--#INCLUDE FILE="../includes/topbar.asp"--> <% if request("tname") <> "" then session("tname") = request("tname") end if if request("nav") <> "" then session("pagename") = Request.ServerVariables ("script_name") if len(Request.QueryString) > 0 then session("pagename") = session("pagename") & "?" & Request.QueryString end if end if if request("nav") = "Edit_My_Details" then session("pagename") = "admin.asp" id = session("userid") end if if request("nav") = "Keywords" then session("pagename") = "admin.asp" 'id = 1 end if if request("activate") = "true" then        ' activate if request("type") = "2" then sql = "update product set fkactiveid = 1 where pkproductid = " & cint(request("id")) else sql = "update product set fkactiveid = 2 where pkproductid = " & cint(request("id")) end if oConn.execute(sql) end if  tablename = session("tname") pagename = "generic.asp" listsql = "select * from " & tablename & " where pk" & tablename & "id <> 0 " if request("parentid") <> "" then parentid = cint(request("parentid")) listsql = listsql & " and fkparentid = " & parentid end if todaydate = year(date) & "/" & month(date) & "/" & day(date) if session("app") = "agritrader" then todaydate = "'" & todaydate & "'" else todaydate = "#" & todaydate & "#" end if if request("type") <> "" then listsql = listsql & " and fkactiveid = " & request("type") if cint(request("type")) = 1 then listsql = listsql & " or product.start_date >= " & todaydate & " or product.expiry_date <= " & todaydate  else listsql = listsql & " and product.start_date <= " & todaydate & " AND product.expiry_date >= " & todaydate end if end if todaydate = year(date) & "/" & month(date) & "/" & day(date) if request("fkproductid") <> "" then  ' link table listsql = listsql & " and fkproductid = " & request("fkproductid") end if if request("fkproductid") <> "" then  ' link table listsql = listsql & " and fkproductid = " & request("fkproductid") session("selectedid") = request("fkproductid") end if if not session("super_user") then  if request("tname") = "agent" and lcase(session("usertype")) = "principal" then  listsql = listsql & " and fkprincipalid = " & cint(session("userid")) end if if (request("tname") = "client" or request("tname") = "product") and lcase(session("usertype")) = "principal" then  listsql = listsql & " and fkprincipalid = " & cint(session("principalid")) end if if (request("tname") = "client" or request("tname") = "product") and lcase(session("usertype")) = "agent" then  listsql = listsql & " and fkagentid = " & cint(session("agentid")) end if end if if tablename = "product" then listsql = listsql & " order by reference_number desc" else listsql = listsql & " order by " & tablename & "_name" end if if request("submit1") = "Submit" then if request("tname") <> "" then session("tname") = request("tname") tablename = request("tname") end if if request("action") = "add" then                ' insert for myqty = 1 to cint(request("myqty")) if not insert(tablename, lngerr, strmsg, inssql, myqty) then if session("pagename") = "" then Response.Redirect "admin.asp" else Response.Redirect session("pagename") end if 'Response.Write "Insert failed for tablename " & tablename & " : " & strmsg & "<br><br> sql: " & replace(inssql,VbCrlf,"<br>") & "  <br><br><a href=# onclick=history.back();>Try again</a>"    'Response.end 'exit for else ' send email for new product if session("tname") = "product" then  SendFrom = session("useremail") strSubject = "New Product (" & request("strProduct_Name") & ") added to website from user: " & session("username") strBody = strSubject & vbcrlf & vbcrlf strBody = strBody & "Please login to <a href></a> to activate this product." & vbcrlf & vbcrlf strBody = strBody & "Thank you." if Request.ServerVariables ("local_addr") = session("myIP") then SendTo = "pjenkins@mweb.com" else SendTo = session("mailto")    end if Call CDONTSMail(SendFrom, SendTo, strSubject, strBody) 'Response.Write "email sent to " & SendTo 'Response.end end if end if next %> <!--#INCLUDE FILE="includes/close.asp"-->

Reply With Quote
  #6  
Old May 2nd, 2008, 06:23 AM
Hane Hane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 6 Hane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
Here is from top of page to a bit below the error

Reply With Quote
  #7  
Old May 2nd, 2008, 06:33 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,831 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 15 h 16 m 28 sec
Reputation Power: 57
That doesn't really answer my question. Open the file which contains the insert(...) sub/function and post the code so that we can see it...

Reply With Quote
  #8  
Old May 2nd, 2008, 03:39 PM
Hane Hane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 6 Hane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
I have no idea what you are talking about I dont know java can only do basic html thats why i dont change the things that i dont know of and thats why i dont understand whats going wrong, it worked fine yesterday

Reply With Quote
  #9  
Old May 2nd, 2008, 03:44 PM
Hane Hane is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 6 Hane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
Sorry. this was the vars file

Reply With Quote
  #10  
Old May 3rd, 2008, 07:36 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 9,962 micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 2 Weeks 4 Days 13 h 54 m 16 sec
Reputation Power: 1275
Hane, please delete username/password of database from above post ........... infact u might change them now!!

What selwonk means is that u have this line
Code:
if not insert(tablename, lngerr, strmsg, inssql, myqty) then
now do u have any function insert anywhere??

u have included vars.asp on top of this page, may be that has the function, post its content.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Wrong number of arguments or invalid property assignment: 'insert'


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: &ra