L
led
i have this code:
<%
Dim myConnString
Dim myConnection
Dim mySQL
myConnString = Application("basededados1_ConnectionString")
Set myConnection = Server.CreateObject("ADODB.Connection")
myConnection.Open myConnString
mySQL= "INSERT INTO casas"
mySQL= mySQL &
"(proprietario,[designação],tipo,piscina,grelhador,roupas,[televisão],ar_condicionado,localidade,dist_praia,pessoas,sessid)
"
mySQL= mySQL & "VALUES ('" & request("proprietario") & "','"
mySQL= mySQL & request("designacao")
mySQL= mySQL & "','" & request("tipo")
mySQL= mySQL & "','" & request("piscina")
mySQL= mySQL & "','" & request("grelhador")
mySQL= mySQL & "','" & request("roupas")
mySQL= mySQL & "','" & request("televisao")
mySQL= mySQL & "','" & request("ar_condicionado")
mySQL= mySQL & "','" & request("localidade")
mySQL= mySQL & "','" & request("dist_praia")
mySQL= mySQL & "','" & request("pessoas")
mySQL= mySQL & "','" & request("sess") & "')"
response.write(mysql)
myConnection.Execute mySQL
myConnection.Close
Set myConnection = Nothing
%>
it was nice when a error occurs ,ex: index duplicates ,a custom message .
this is the error:
Microsoft JET Database Engine error '80004005'
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.
<%
Dim myConnString
Dim myConnection
Dim mySQL
myConnString = Application("basededados1_ConnectionString")
Set myConnection = Server.CreateObject("ADODB.Connection")
myConnection.Open myConnString
mySQL= "INSERT INTO casas"
mySQL= mySQL &
"(proprietario,[designação],tipo,piscina,grelhador,roupas,[televisão],ar_condicionado,localidade,dist_praia,pessoas,sessid)
"
mySQL= mySQL & "VALUES ('" & request("proprietario") & "','"
mySQL= mySQL & request("designacao")
mySQL= mySQL & "','" & request("tipo")
mySQL= mySQL & "','" & request("piscina")
mySQL= mySQL & "','" & request("grelhador")
mySQL= mySQL & "','" & request("roupas")
mySQL= mySQL & "','" & request("televisao")
mySQL= mySQL & "','" & request("ar_condicionado")
mySQL= mySQL & "','" & request("localidade")
mySQL= mySQL & "','" & request("dist_praia")
mySQL= mySQL & "','" & request("pessoas")
mySQL= mySQL & "','" & request("sess") & "')"
response.write(mysql)
myConnection.Execute mySQL
myConnection.Close
Set myConnection = Nothing
%>
it was nice when a error occurs ,ex: index duplicates ,a custom message .
this is the error:
Microsoft JET Database Engine error '80004005'
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.