Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Insert Into in ASP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-19 : 08:55:23
Kerr writes "This script returns Too few parameters. Expected 2. on line 10:
i don't know whats wrong with it. any ideas? I am running a windows 2000 server, sp2, with iis 5.

%@LANGUAGE="JAVASCRIPT"

var first_name = "Bornwyn";
var last_name = "Semer";


var insert_record = Server.CreateObject("ADODB.Connection");
insert_record.connectionstring = "dsn=srn;";
insert_record.Open();
insert_record.Execute("INSERT INTO customers(cu_first_name,cu_last_name) VALUES (" + first_name + "," + last_name + ")");


thankyou for your help
~Kerr"

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-04-19 : 10:43:59
it looks like you're missing the text delimiter character ( the single quote ) around your first_name and last_name variables.

quote:

Kerr writes "This script returns Too few parameters. Expected 2. on line 10:
i don't know whats wrong with it. any ideas? I am running a windows 2000 server, sp2, with iis 5.

%@LANGUAGE="JAVASCRIPT"

var first_name = "Bornwyn";
var last_name = "Semer";


var insert_record = Server.CreateObject("ADODB.Connection");
insert_record.connectionstring = "dsn=srn;";
insert_record.Open();
insert_record.Execute("INSERT INTO customers(cu_first_name,cu_last_name) VALUES (" + first_name + "," + last_name + ")");


thankyou for your help
~Kerr"



setBasedIsTheTruepath
<O>
Go to Top of Page
   

- Advertisement -