Auto increment seed entry problem

Results 1 to 2 of 2

Thread: Auto increment seed entry problem

  1. #1
    Cindy Guest

    Default Auto increment seed entry problem

    We are unable to add new record in a table where we have defined the seed value. I have made up a example below to show you the problem we are having, Your cooperation is needed desperately. <BR>----------------table structure --------------- <BR>In a Sql database table <BR>column name= id ,Datatype = integer , length=4 ,precision=10, allownull=not checked , identity=check marked , <BR>identity seed = 1 , identity increment=1 <BR>------------------------------------------------------- <BR>-- By .asp form we are trying to add value in this table, and in field id we wanted sql server to automatically add a new value at every record by incrementing as we specified above. <BR><BR>------------------------------------- <BR><BR><BR>--------portion of my coding I have written is like this---------- <BR><BR>&#060;% <BR>Sender=request.form("T1") <BR>set rs=server.createobject("ADODB.recordset") <BR>sql="select * from subemail " <BR>set rs.ActiveConnection = con <BR> sql,con,3,3 <BR>rs.addnew <BR>rs("email")=sender <BR><BR>rs.update <BR>%&#062; <BR><BR>------------------- <BR>But once we try to add the value i get the following arroe at the line where it is rs.update <BR><BR>-------------error we get ------------------------- <BR>we get error on line rs.update were it&#039;s supposed to add new record in the table. <BR>=error=============================== <BR>Microsoft OLE DB Provider for SQL Server error &#039;80040e21&#039; <BR>Errors occurred <BR>/problem/receive.asp, line 41 <BR>and line 41 is : rs.update <BR><BR><BR>----------------------- <BR>as this is the same file and the same structure at my desktop which works fine but when i uploaded to a ISP it gives problem and my isp says they dont support coding. Now the next question you might ask if i have the right to add data in the databse. yes we do. as if i try to add a data in any other table which is not using the seed increment i canadd the records in those tables. the problem i facing is only with the tables i have given seed increment in the SQL. I am in biiig touble. please help. i am logged on in yahoo messenge if u can chat with my id will be helpfull. my yahoo chat id is cindysoftprogra .or if u can email will be appreciated <BR>I had posted this problem on other sites also but no help. <BR><BR> 772721023 <BR><BR><BR>Gracias (thank you) <BR>Cindy <BR>

  2. #2
    Heaven's Martini Guest

    Default RE: Auto increment seed entry problem

    okay<BR><BR>set rs=server.createobject("ADODB.connection") <BR>sql="select * from subemail " <BR>set rs.ActiveConnection = con <BR> sql,con,3,3 <BR>rs.addnew <BR>rs("email")=sender <BR><BR>rs.update <BR><BR>to be honest with you, ihae no idea what you are doing/<BR><BR>you want to update the email address (the identity has nothing to do with that error, to my knowledge.)<BR><BR>in pseudo<BR>sql = "Update tablename SET columnname=&#039;"& yourar &"&#039; where columnidentifier = "& id &""<BR>create connection<BR>open connection &#039; connection object, not recordset<BR>connection.execute(sql)<BR>destroy connection<BR><BR>this should be straightforward.<BR><BR><BR>%&#062; <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts