I
isaac_2004
hi am getting this error on my site that checks for shipping
information with a form field and checks the db with the querystring
values
The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or
relationship. Change the data in the field or fields that contain
duplicate data, remove the index, or redefine the index to permit
duplicate entries and try again.
here is the code i use to open the shipping info from the database
'create SQL statement and open the database
strSQL = "SELECT tblCustomers.strEmail, tblCustomers.strFirstName,
tblCustomers.strLastName, tblCustomers.strAddress,
tblCustomers.strCity, tblCustomers.strState, tblCustomers.strZip " & _
"FROM tblCustomers "
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open strSQL, objConn, , 3
response.write "strSQL:" & strSQL & "<br>"
'tests database for record, if none creates new column
If objRS.EOF then
objRS.AddNew
end if
'puts local variables into databse
objRS("strFirstName") = strFirstName
objRS("strLastName") = strLastName
objRS("strAddress") = strAddress
objRS("strCity") = strCity
objRS("strState") = strState
objRS("strZip") = strZip
objRS("strEmail") = strEmail
response.write(objRS("strEmail"))
-------------------------------------error thrown here
objRS.Update
-------------------------------------------
objRS.close
'Set objRS = nothing
'objConn.close
'Set objRS = nothing
thanks for the help
information with a form field and checks the db with the querystring
values
The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or
relationship. Change the data in the field or fields that contain
duplicate data, remove the index, or redefine the index to permit
duplicate entries and try again.
here is the code i use to open the shipping info from the database
'create SQL statement and open the database
strSQL = "SELECT tblCustomers.strEmail, tblCustomers.strFirstName,
tblCustomers.strLastName, tblCustomers.strAddress,
tblCustomers.strCity, tblCustomers.strState, tblCustomers.strZip " & _
"FROM tblCustomers "
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open strSQL, objConn, , 3
response.write "strSQL:" & strSQL & "<br>"
'tests database for record, if none creates new column
If objRS.EOF then
objRS.AddNew
end if
'puts local variables into databse
objRS("strFirstName") = strFirstName
objRS("strLastName") = strLastName
objRS("strAddress") = strAddress
objRS("strCity") = strCity
objRS("strState") = strState
objRS("strZip") = strZip
objRS("strEmail") = strEmail
response.write(objRS("strEmail"))
-------------------------------------error thrown here
objRS.Update
-------------------------------------------
objRS.close
'Set objRS = nothing
'objConn.close
'Set objRS = nothing
thanks for the help