Click here to Skip to main content
15,913,129 members
Home / Discussions / Database
   

Database

 
QuestionMessage Removed Pin
11-Aug-10 12:50
john john mackey11-Aug-10 12:50 
AnswerRe: Synchronizing form interaction Pin
Mycroft Holmes11-Aug-10 14:51
professionalMycroft Holmes11-Aug-10 14:51 
Questionnvarchar(max)(To Be Or Not To Be) Pin
moein.serpico11-Aug-10 4:39
moein.serpico11-Aug-10 4:39 
AnswerRe: nvarchar(max)(To Be Or Not To Be) Pin
Chris Meech11-Aug-10 6:25
Chris Meech11-Aug-10 6:25 
AnswerRe: nvarchar(max)(To Be Or Not To Be) Pin
Jörgen Andersson11-Aug-10 9:23
professionalJörgen Andersson11-Aug-10 9:23 
AnswerRe: nvarchar(max)(To Be Or Not To Be) Pin
PIEBALDconsult11-Aug-10 16:06
mvePIEBALDconsult11-Aug-10 16:06 
AnswerRe: nvarchar(max)(To Be Or Not To Be) Pin
David Skelly12-Aug-10 2:21
David Skelly12-Aug-10 2:21 
QuestionTrouble with SQL Server Records Updation Pin
swornavidhya_m11-Aug-10 3:54
swornavidhya_m11-Aug-10 3:54 
Problem we are Facing Currently: Records getting inserted as only one during the process of updating the server.

Previously, all the given records get inserted into the database table during the updation process.

"updateprice" is the .mdb exists locally in the same folder where the calling file for updating records exists. It contains record data to be uploaded to the server database. It acts as an temporary storage database.

The records to be updated to the server are either in an notepad or excel. Whatever be the count in records, previously it was updated fine. "rsTextData.Update" is line 86. I'm blinking where it fails.The error which we're facing and the code is given below for the assistance.
Error Showing as
****************
1 record(s) converted
File Name:DTRinggit081110Ringgit Extends Downtrend Against Greenback 
Microsoft OLE DB Provider for ODBC Drivers error '80004005' 

[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint 'PK_text_data'. Cannot insert duplicate key in object 'text_data'. 

/data_maintain/News.asp, line 86 


code
****
<table width="100%" cellspacing="0" cellpadding="0" align="center">

<tr><td height="25" class="mtext" background="../images/top_bar.jpg" align="center"><font color="#FFFFFF"><b>ADMINISTRATION</b></font></td></tr>
<tr><td height="10"></td></tr>
<tr><td height="20"></td></tr>

<tr><td width="100%" class="mtext">
<p style="margin-left: 10; margin-right: 3">
<center>
    <b> Uploading  Text Data in progress...<br>
	<br>Please wait..</b>
</center>	
	
	<%
  	set myconn=server.createobject("ADODB.connection")
  	
  	myconn.open "updateprice"
  	myconn.CommandTimeout=0
  	set rsData = Server.CreateObject ("ADODB.Recordset")

	NewsCodeSelectSql="Select * from text_data"
	set rsData=myconn.execute(NewsCodeselectsql)
	code = 0 
	intRecCount = 0
	set myconn1=server.createobject("ADODB.connection")
  	myconn1.open "DSN=commodities;uid=fbspl07;pwd=07#web&;"
	myconn1.commandtimeout=0
	Response.Write("1  record(s) converted<br>")
	do while not rsdata.eof
	Set cmdTemp=Server.CreateObject("ADODB.Command")
	cmdTemp.CommandType=2
		sql="select * from text_Data where 1<>1"
		
		set rsTextData=Server.CreateObject("ADODB.Recordset")
		
		rstextdata.locktype=adLockOptimistic
		
		rsTextData.Open "select * from text_Data where 1<>1",myconn1 
		msgbox rsTextData.RecordCount 
		rsTextData.Addnew
		 	response.write "File Name:" &rsdata(3)
		   'response.write "Title:      " &rsdata(4)&"<br>"
		   
			rsTextData("Text_id")=rsdata(0)
			rsTextData("Date1")=rsdata(1)
			rsTextData("Comname_id")=rsdata(2)
			rsTextData("Filename")=rsdata(3)
			'response.write "Title= " & rsdata(4) &"<br>"	
			title1=replace(rsdata(4),"("," ")
			title1=replace(title1,")"," ")
			title1=replace(title1,":","-")
			response.write title1
			'response.end
			rsTextData("Title")=title1
			
			'rsTextData("Title")= rsdata(4)
			rsTextData("Source")=rsdata(5)
			rsTextData("isspot")=rsdata(6)
			rsTextData("Module_type")=rsdata(7)
			rsTextData("Submodule_type")=rsdata(8)
			rsTextData("Time1")=time()
		rsTextData.Update 

		rsTextData.close
		rsData.movenext
		code = code + 1
		If code mod 25 = 0 then
		  Response.Write(code &"  records converted<br>")
		end If  	
	loop	

	response.WRITE("<br><br><b> Text Data is Inserted Successfully....</b><br><br>")	
%>

<p align="RIGHT"><a href="javascript:history.back()" target="_parent"><font face="Arial" size="2">Back</font></a>&nbsp;</td></tr>

<tr><td height="20"></td></tr>

</table>

M.Sworna Vidhya

AnswerRe: Trouble with SQL Server Records Updation Pin
Eddy Vluggen11-Aug-10 6:22
professionalEddy Vluggen11-Aug-10 6:22 
GeneralRe: Trouble with SQL Server Records Updation Pin
swornavidhya_m11-Aug-10 18:45
swornavidhya_m11-Aug-10 18:45 
GeneralRe: Trouble with SQL Server Records Updation Pin
Eddy Vluggen11-Aug-10 20:42
professionalEddy Vluggen11-Aug-10 20:42 
GeneralRe: Trouble with SQL Server Records Updation Pin
swornavidhya_m11-Aug-10 21:19
swornavidhya_m11-Aug-10 21:19 
GeneralRe: Trouble with SQL Server Records Updation Pin
Eddy Vluggen11-Aug-10 21:39
professionalEddy Vluggen11-Aug-10 21:39 
QuestionQuery performance Pin
SatyaKeerthi159-Aug-10 23:09
SatyaKeerthi159-Aug-10 23:09 
AnswerRe: Query performance Pin
Eddy Vluggen9-Aug-10 23:23
professionalEddy Vluggen9-Aug-10 23:23 
AnswerRe: Query performance Pin
dan!sh 10-Aug-10 5:15
professional dan!sh 10-Aug-10 5:15 
AnswerRe: Query performance PinPopular
scottgp10-Aug-10 6:55
professionalscottgp10-Aug-10 6:55 
GeneralRe: Query performance Pin
Jörgen Andersson10-Aug-10 8:07
professionalJörgen Andersson10-Aug-10 8:07 
GeneralRe: Query performance Pin
Mycroft Holmes10-Aug-10 14:48
professionalMycroft Holmes10-Aug-10 14:48 
GeneralRe: Query performance Pin
PIEBALDconsult10-Aug-10 17:59
mvePIEBALDconsult10-Aug-10 17:59 
AnswerRe: Query performance Pin
Bernhard Hiller10-Aug-10 20:17
Bernhard Hiller10-Aug-10 20:17 
Questionhow to write a query change the datatype for primary key coulm in atable using sqlserver 2008. Pin
Ch.Gayatri Subudhi9-Aug-10 19:42
Ch.Gayatri Subudhi9-Aug-10 19:42 
AnswerRe: how to write a query change the datatype for primary key coulm in atable using sqlserver 2008. Pin
Mycroft Holmes9-Aug-10 21:13
professionalMycroft Holmes9-Aug-10 21:13 
GeneralRe: how to write a query change the datatype for primary key coulm in atable using sqlserver 2008. Pin
Ch.Gayatri Subudhi9-Aug-10 21:19
Ch.Gayatri Subudhi9-Aug-10 21:19 
GeneralRe: how to write a query change the datatype for primary key coulm in atable using sqlserver 2008. Pin
Mycroft Holmes9-Aug-10 21:26
professionalMycroft Holmes9-Aug-10 21:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.