Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Next Recod in the Insert Statement


Message #1 by "Pritesh Badiani" <pritesh_b@t...> on Thu, 22 Nov 2001 18:25:28 -0000
Hi 



I am having a problem using the INSERT statement.



I have a table "Information" with the following :



	Name

	Email

	Comments

	ID (Auto Number)



I have the following insert statement



Insert into Information VALUES (MyName,Email@M...,MyComments);



Now I get the following error :



Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected

1.



How do I get the ID ( Auto Number ) to automatically increment a number.

I looked in help and it said for Oracle it gave an example ID.nextval.



I am using Access XP with .NET Beta2



Thanks very much,



Pritesh









-----Original Message-----

From: Pieter [mailto:pieter.schockaert@c...] 

Sent: 21 November 2001 11:08

To: Access ASP

Subject: [access_asp] confirmation of sql statements



Hi all,



If I execute the SQL statement:

rs = conn.Execute(sql);

where sql can be an insert, update or delete, how do I know if that

action 

really is executed? Is there a way to check this (e.g. rs == -1)?



thanks,



Pieter




$subst('Email.Unsub')



Message #2 by "Pritesh Badiani" <pritesh_b@t...> on Thu, 22 Nov 2001 22:46:51 -0000
More Information on this:



My Code



<%

OSQL= "SELECT Visitors.Name, Visitors.Compname, Visitors.Phone,

Visitors.Email, Visitors.Comments FROM Visitors;"



SQL= "INSERT into Visitors (Name,Compname,Phone,Email,Comments) Values

('Visitors Name', 'Visitors Compname','020','Visitors Email', 'Visitors

Comments');"



set conn = Server.CreateObject("ADODB.Connection")

conn.open "guest"

'set data=conn.execute(SQL)

'

conn.Execute (SQL)



%>



the OSQL = Select Query works a treat but the insert doesn't



Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[Microsoft][ODBC Microsoft Access Driver] Operation must use an

updateable query.

/form/addinfo.asp, line 10





What does updateable query mean?



Please help



Thanks



Pritesh





-----Original Message-----

From: Pritesh Badiani [mailto:pritesh_b@t...] 

Sent: 22 November 2001 18:25

To: Access ASP

Subject: [access_asp] Next Recod in the Insert Statement



Hi 



I am having a problem using the INSERT statement.



I have a table "Information" with the following :



	Name

	Email

	Comments

	ID (Auto Number)



I have the following insert statement



Insert into Information VALUES (MyName,Email@M...,MyComments);



Now I get the following error :



Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected

1.



How do I get the ID ( Auto Number ) to automatically increment a number.

I looked in help and it said for Oracle it gave an example ID.nextval.



I am using Access XP with .NET Beta2



Thanks very much,



Pritesh









-----Original Message-----

From: Pieter [mailto:pieter.schockaert@c...] 

Sent: 21 November 2001 11:08

To: Access ASP

Subject: [access_asp] confirmation of sql statements



Hi all,



If I execute the SQL statement:

rs = conn.Execute(sql);

where sql can be an insert, update or delete, how do I know if that

action 

really is executed? Is there a way to check this (e.g. rs == -1)?



thanks,



Pieter




$subst('Email.Unsub')








$subst('Email.Unsub')



Message #3 by "Ken Schaefer" <ken@a...> on Fri, 23 Nov 2001 16:53:18 +1100
www.adopenstatic.com/faq/80040e10.asp covers your error message



www.adopenstatic.com/experiments/fastestautonumber.asp explains how to get

the autonumber of the newly inserted record.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Pritesh Badiani" <pritesh_b@t...>

Subject: [access_asp] Next Recod in the Insert Statement





: Hi

:

: I am having a problem using the INSERT statement.

:

: I have a table "Information" with the following :

:

: Name

: Email

: Comments

: ID (Auto Number)

:

: I have the following insert statement

:

: Insert into Information VALUES (MyName,Email@M...,MyComments);

:

: Now I get the following error :

:

: Error Type:

: Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)

: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected

: 1.

:

: How do I get the ID ( Auto Number ) to automatically increment a number.

: I looked in help and it said for Oracle it gave an example ID.nextval.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index