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
 Transact-SQL (2000)
 How to inplement a recordset.addnew action.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-03-19 : 09:29:21
Song writes "I am a absolutely new comer for SQL server 2000+ASP.
I am now dealing with a two level tables, having parent entity connecting to a child weak entity. I need to perform some add new dates and modify actions. Presently, I read a lot from Internet, your website and 4guysForm. While I want to try out some simplest action like add data to a one category table. For example, Table Enter with one category Enterdate. I would like to add one data to this table but always failed due to an error ADODB.Recordset (0x800A0CB3). This is the code I am now engaged with. I read something indicating I may define CursorType manually to implement AddNew action.

"connections/sql.inc"

Dim MyDatabase
MyDatabase= "Provider=SQLOLEDB;Persist Security Info=False;Data Source=SC05054600;Initial Catalog=New Project;User Id=sa;Password="


"enter.asp"
<!-- #include file="connections/SQL.inc"-->

If Request("entervalues") <> "" Then
Response.write(Request("entervalues"))
dim conn, rs
set conn=Server.CreateObject("ADODB.connection")
set rs=Server.CreateObject("ADODB.recordset")
conn.open MyDatabase
rs.activeconnection=conn
rs.open "Select Enter From EnterValues", Conn
En=Request("entervalues")
rs.addnew "Enter", "En"
Response.write
rs.open "Select Enter From EnterValues", Conn
Do While Not rs.eof
response.write(Enter)
rs.Movenext
Loop
rs.close
set conn=nothing
set rs=nothing
End if



<form name="form1" method="post" action="enter.asp">
Enter a valid character or a word: <input type="text" name="entervalues">
<input type="submit" name="submit" value="submit">
</form>"
   

- Advertisement -