hola amigos de foro de php
estoy intentando introducir los datos de un formulario en una base de datos en access, pero a la hora de abrir el formulario donde se encuentra el botón de enviar me sale el siguiente error
[Microsoft][Controlador ODBC Microsoft Access] No coinciden los tipos de datos en la expresión de criterios.
seguramente sea por los numero o las comillas en campos numericos pero es que intento cambiar el campo , es decir quitarles las comillas a estos campos y me sale error.
aqui os envio todo el codigo del formulario.
Código PHP:
body {
background-color: #CCCCCC;
}
.Estilo1 {font-size: 12px}
.Estilo2 {font-family: "Times New Roman", Times, serif}
-->
</style></head>
<body>
<form action="insert_dapersonal.php">
<table width="78%" border="1" bordercolor="#009966">
<tr>
<td width="5%" scope="col"><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2">Nom</span></span></span></div></td>
<th width="19%" scope="col">
<div align="left">
<input type="text" name="Nom">
</div></th>
<td width="7%" scope="col"><div align="left"><span class="Estilo1">Cognoms</span></div></td>
<th width="19%" scope="col">
<div align="left">
<input type="text" name="Cognoms">
</div></th>
<td width="5%" scope="col"><div align="left" class="Estilo1">
<div align="left">DNI</div>
</div></td>
<th width="45%" class="Estilo1" scope="col">
<div align="left">
<input type="text" name="DNI">
</div></th>
</tr>
<tr>
<td height="24"><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2">Estat</span></span></span></div></td>
<td>
<div align="left">
<select name="Estat"><option value="<?php include_once ("c:\adodb\adodb.inc.php"); $connexio = NewADOConnection("access");
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\RRHHprg.mdb;";
$sql ="select * from VEstats";
$connexio->Connect($dsn) or die ("No s'ha pogut connectar amb la BD");
$rs = $connexio->Execute($sql);
print $rs->fields['1'].' '.$rs->fields['1'].'<BR>';
print $rs->GetMenu('VEstat',$rs,false);
?>">
</select>
</div></td>
<td><div align="left"><span class="Estilo1">Noperari</span></div></td>
<td>
<div align="left">
<input type="text" name="Noperari">
</div></td>
<td><div align="left" class="Estilo1">Localitat</div></td>
<td>
<div align="left">
<input type="text" name="Localitat">
</div></td>
</tr>
<tr>
<td><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2">Adreça</span></span></span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="Adreça">
</span></div></td>
<td class="Estilo1"><div align="left"><span class="Estilo2">Província</span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="Província">
</span></div></td>
<td class="Estilo1"><div align="left">CP</div></td>
<td>
<div align="left">
<input type="text" name="CP">
</div></td>
</tr>
<tr>
<td><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2">Email</span></span></span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="Email">
</span></div></td>
<td class="Estilo1"><div align="left"><span class="Estilo2">Telèfon</span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="Telèfon">
</span></div></td>
<td class="Estilo1"><div align="left">Nacionalitat</div></td>
<td>
<div align="left">
<input type="text" name="Nacionalitat">
</div></td>
</tr>
<tr>
<td><div align="left"><span class="Estilo1">DNaixement</span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="DNaixement">
</span></div></td>
<td class="Estilo1"><div align="left"><span class="Estilo2">NFills</span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="NFills">
</span></div></td>
<td class="Estilo1"><div align="left">Ecivil</div></td>
<td>
<div align="left">
<select name="ECivil">
<option>Solter/a</option>
<option>Casat/a</option>
<option>Divorciat/da</option>
<option>Separat/da</option>
<option>Vidu/a</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2">PResidència</span></span></span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="PResidència">
</span></div></td>
<td class="Estilo1"><div align="left"><span class="Estilo2">NSS</span></div></td>
<td><div align="left"><span class="Estilo2">
<input type="text" name="NSS">
</span></div></td>
<td><div align="left" class="Estilo1">Empresa</div></td>
<td>
<div align="left">
<select name="Empresa">
<option value="">
</select>
</div></td>
</tr>
<tr>
<td><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2">Departament</span></span></span></div></td>
<td><div align="left"><span class="Estilo2">
<select name="Departament">
<option value="<?php include_once ("c:\adodb\adodb.inc.php"); $connexio = NewADOConnection("access");
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\RRHHprg.mdb;";
$sql ="select distinct * from VDepartaments";
$connexio->Connect($dsn) or die ("No s'ha pogut connectar amb la BD");
$rs = $connexio->Execute($sql);
print $rs->fields['1'].' '.$rs->fields['1'].'<BR>';
print $rs->GetMenu('Departament',$rs,false);
?>">
</select>
</span></div></td>
<td class="Estilo1"><div align="left"><span class="Estilo2">Àrea</span></div></td>
<td><div align="left"><span class="Estilo2">
<select name="Area">
<option value="<?php include_once ("c:\adodb\adodb.inc.php"); $connexio = NewADOConnection("access");
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\RRHHprg.mdb;";
$sql ="select * from VArees";
$connexio->Connect($dsn) or die ("No s'ha pogut connectar amb la BD");
$rs = $connexio->Execute($sql);
print $rs->fields['1'].' '.$rs->fields['1'].'<BR>';
print $rs->GetMenu('VArees',$rs,false);
?>">
</select>
</span></div></td>
<td><div align="left" class="Estilo1">Lloc Treball </div></td>
<td>
<div align="left">
<select name="LTreball">
<option value="<?php include_once ("c:\adodb\adodb.inc.php"); $connexio = NewADOConnection("access");
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\RRHHprg.mdb;";
$sql ="select * from VLTreball";
$connexio->Connect($dsn) or die ("No s'ha pogut connectar amb la BD");
$rs = $connexio->Execute($sql);
print $rs->fields['1'].' '.$rs->fields['1'].'<BR>';
print $rs->GetMenu('VLTreball',$rs,false);
?>">
</select>
</div></td>
</tr>
<tr>
<td><div align="left"><span class="Estilo1"><span class="Estilo1"><span class="Estilo2"></span></span></span></div></td>
<td><div align="left">
<input type="submit" name="Submit" value="Enviar"><?php
include_once("c:\adodb\adodb.inc.php");
$conn = NewADOConnection("access");
$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\bd1.mdb;";
$conn->Connect($dsn) or die ("No s'ha pogut connectar amb la BD");
$sql ="INSERT INTO Personal VALUES ('".$_POST['Nom'] . "','" .$_POST['Cognoms'] ."','" .$_POST['DNI'] . "','" .$_POST['Estat'] . "','" .$_POST['Noperari'] . "','" .$_POST['Localitat'] . "','" .$_POST['Adreça'] . "','" .$_POST['Província'] . "','" .$_POST['CP'] . "','" .$_POST['Email'] . "','" .$_POST['Telèfon'] . "','" .$_POST['Nacionalitat'] . "','" .$_POST['DNaixement'] . "','" .$_POST['NFills'] . "','" .$_POST['ECivil'] . "','" .$_POST['PResidència'] . "','" .$_POST['NSS'] . "','" .$_POST['Empresa'] . "','" .$_POST['Departament'] . "','" .$_POST['Area'] . "','" .$_POST['LTreball'] . "');";
$recordSet = $conn->Execute($sql);
if (!$recordSet)
print $conn->ErrorMsg();
else
while (!$recordSet->EOF) {
print $recordSet->fields[0].' '.$recordSet->fields[1].'<BR>';
$recordSet->MoveNext();
}
?>
</table></form>
</body>
</html>
gracias de antemano,
hasta luego