Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: RE: Insert Error


Message #1 by "Drew, Ron" <RDrew@B...> on Thu, 18 Jul 2002 08:13:24 -0400
Comment out the
ObjdbConn.Execute(SQL)
And add
Response.write SQL
See what the statement looks like

-----Original Message-----
From: sanjeet1@h... [mailto:sanjeet1@h...]
Sent: Thursday, July 18, 2002 2:11 AM
To: ASP Databases
Subject: [asp_databases] Insert Error


Hello,

I am having problems with my SQL statement I keep getting:

Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'Execute'
/ApexCalender/ProcessRegistration.asp, line 79

This is my code:

 'Create and open the Connection object.
Set OBJdbConn =3D Server.CreateObject("ADODB.Connection")
'OBJdbConn.CursorLocation =3D adUseClient
OBJdbConn.Open sConnStr


SQL =3D "INSERT INTO RegistrationInformation "
SQL=3DSQL & "(InformationRequested,FirstName,LastName,"
SQL=3DSQL & " Address,City,State,Zip,Email,Phone,Fax )VALUES "
SQL=3DSQL & "('" & strRequestInfo & "','"
SQL=3DSQL & strFirstName & "','"
SQL=3DSQL & strLastName & "','"
SQL=3DSQL & strAddress & "','"
SQL=3DSQL & City & "','"
SQL=3DSQL & State & "','"
SQL=3DSQL & Zip & "','"
SQL=3DSQL & Email & "','"
SQL=3DSQL & Phone & "','"
SQL=3DSQL & Fax & ")"

ObjdbConn.Execute(SQL)


OBJdbConn.Close
Set RSreg =3D Nothing
Set OBJdbConn =3D Nothing
Message #2 by "Vaishnavi" <mail2vaish@y...> on Thu, 18 Jul 2002 06:40:12
If this is not a typo whiel sending this message, then most probably the 
problem is the last line while forming SQL

SQL=SQL & Phone & "','" 
SQL=SQL & Fax & ")"

It should be 
SQL=SQL & Phone & "','" 
SQL=SQL & Fax & "')"

The ' was missing after Fax , which meants that the SQL was nnot complete

Guess this should solve ur problem



> Hello,

> I am having problems with my SQL statement I keep getting:

> Error Type:
M> icrosoft VBScript runtime (0x800A01C2)
W> rong number of arguments or invalid property assignment: 'Execute'
/> ApexCalender/ProcessRegistration.asp, line 79

> This is my code:

>  'Create and open the Connection object.
S> et OBJdbConn = Server.CreateObject("ADODB.Connection") 
'> OBJdbConn.CursorLocation = adUseClient
O> BJdbConn.Open sConnStr

> 
S> QL = "INSERT INTO RegistrationInformation "
S> QL=SQL & "(InformationRequested,FirstName,LastName,"
S> QL=SQL & " Address,City,State,Zip,Email,Phone,Fax )VALUES "
S> QL=SQL & "('" & strRequestInfo & "','" 
S> QL=SQL & strFirstName & "','" 
S> QL=SQL & strLastName & "','" 
S> QL=SQL & strAddress & "','" 
S> QL=SQL & City & "','" 
S> QL=SQL & State & "','" 
S> QL=SQL & Zip & "','" 
S> QL=SQL & Email & "','" 
S> QL=SQL & Phone & "','" 
S> QL=SQL & Fax & ")"

> ObjdbConn.Execute(SQL)

> 
O> BJdbConn.Close
S> et RSreg = Nothing
S> et OBJdbConn = Nothing
Message #3 by sanjeet1@h... on Thu, 18 Jul 2002 06:10:52
Hello,

I am having problems with my SQL statement I keep getting:

Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'Execute'
/ApexCalender/ProcessRegistration.asp, line 79

This is my code:

 'Create and open the Connection object.
Set OBJdbConn = Server.CreateObject("ADODB.Connection") 
'OBJdbConn.CursorLocation = adUseClient
OBJdbConn.Open sConnStr


SQL = "INSERT INTO RegistrationInformation "
SQL=SQL & "(InformationRequested,FirstName,LastName,"
SQL=SQL & " Address,City,State,Zip,Email,Phone,Fax )VALUES "
SQL=SQL & "('" & strRequestInfo & "','" 
SQL=SQL & strFirstName & "','" 
SQL=SQL & strLastName & "','" 
SQL=SQL & strAddress & "','" 
SQL=SQL & City & "','" 
SQL=SQL & State & "','" 
SQL=SQL & Zip & "','" 
SQL=SQL & Email & "','" 
SQL=SQL & Phone & "','" 
SQL=SQL & Fax & ")"

ObjdbConn.Execute(SQL)


OBJdbConn.Close
Set RSreg = Nothing
Set OBJdbConn = Nothing

  Return to Index