Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: asp and oracle (addnew)


Message #1 by "Puskar Adhikari" <puskar@h...> on Fri, 22 Sep 2000 16:08:05 EDT
Hi Everyone,

Thanks a lot for your help.

I have been trying too add records to the database using the addnew function 

and seem like it is not looking at the addnew method i have

also included a function that is used in adding to the database which is



*******************************************************************

function addToDatabase(field1, field2, field3)



    Response.Buffer = true

	Set MyConnection = Server.CreateObject("ADODB.Connection")



	'MyConnection.Open "oracletest","scott", "tiger"



	MyConnection.Open Application("Conn_ConnectionString"), "scott", "tiger"

	set RS = Server.CreateObject("ADODB.Recordset")





	RS.Open "ASI", MyConnection, 1, 3



	RS.AddNew



		RS("name") = field1

		RS("id") = field2

		RS("desig") = field3



	RS.Update  'save changes





	If MyConnection.Errors.Count > 0 Then

		addToDatabase = -1

		Response.Write " <P>Error Reported <BR>"

    Else

        addToDatabase = 1

		Response.Write "<BR> Following values have been added to the database "

		Response.Write "<BR>Your Name--> " & field1

		Response.Write "<BR>Your ID--> " & field2

		Response.Write "<BR>Your Job--> " & field3

	End If





	MyConnection.Close   'close database connection

	Set MyCOnnection = Nothing

	Set RS = Nothing



End function



*********************************************************************



But I am not sure why i am getting an error which says



**************************************************************

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

The request properties can not be supported by this ODBC Driver.

**************************************************************





Highly appreciate for any help,



Thank you and have a great day,



Puskar Adhikari :)




  Return to Index