插入表格时出现odbc - 07002错误

时间:2015-01-24 16:07:16

标签: php pdo odbc

我想在* .mdb文件中插入一些数据,但它仍然会因错误07002而死亡。

这是PHP:

    $ex='INSERT INTO `T040_EUD` (C000_ID,C001_Vymazany,C002_Oznaceny,C003_Zamknuty,C004_Systemovy,C005_IDFirma_Partner,C010_IDPartner,C011_IDBankovyUcet_Partner,C012_IDCiselnyRad,C021_CisloInterneTypOkruh,C023_CisloInterneKodOkruh,C024_CisloInterneKodEvidencia,C025_CisloInterneKodCiselnaRada,C026_KodPouzityVzor,C028_KodZaevidoval,C029_KodUzavrel,C030_CisloInterne,C031_CisloExterne,C032_KonstantnySymbol,C033_InterneCisloPDBV,C034_ExterneCisloPDBV,C035_ZnamienkoPDBV,C036_CisloUctuPDBV,C037_SpecifickySymbol,C039_PartnerInterneCislo,C041_PartnerMenoSkratka,C051_PartnerICO,C052_PartnerICOPoradoveCislo,C053_PartnerDIC,C054_PartnerDICX,C055_PartnerKod,C060_DenVystavenia,C061_MesVystavenia,C062_RokVystavenia,C063_DenPrijatia,C064_MesPrijatia,C065_RokPrijatia,C066_DenSplatnosti,C067_MesSplatnosti,C068_RokSplatnosti,C069_DenDUZP,C070_MesDUZP,C071_RokDUZP,C072_DenDUD,C073_MesDUD,C074_RokDUD,C075_DenDUUP,C076_MesDUUP,C077_RokDUUP,C078_UctovneObdobie,C082_CasVystavenia,C083_CasZaevidovania,C096_Popis,C097_Poznamka,C098_Priznaky,C099_VolneDefinovanyText,C103_NEUctovat,C104_Uzavrel,C105_Zaevidoval,C106_PocetDniSplatnosti,C107_DPHPouzita,C108_PREdkontovany,C109_DPHTyp,C110_ChybyDokladu,C114_DenZaevidovania,C115_MesZaevidovania,C116_RokZaevidovania,C117_DenPoslednejOpravy,C118_MesPoslednejOpravy,C119_RokPoslednejOpravy,C120_DenUzavierkyHLK,C121_MesUzavierkyHLK,C122_RokUzavierkyHLK,C123_DenUzavierkyDPHUplatnenej,C124_MesUzavierkyDPHUplatnenej,C125_RokUzavierkyDPHUplatnenej,C126_MesUzavierkyDPHNeuplatnenej,C127_MesUzavierkyDPHUplatnenej,C128_PCUzavierkyHLK,C129_PCUzavierkyDPHUplatnena,C130_RokUzavierkyDPHNeuplatnenej,C131_JCD,C132_UPL,C133_HLK,C140_PCUzavierkyA,C141_PCUzavierkyB,C142_PCUzavierkyD,C143_FixujDUD,C150_IDPovodnyDoklad,C200_Mena,C201_MnozstvoJednotky,C202_KurzNBS,C203_KurzBanka,C210_SumaSpoluZahranicnaMena,C211_SumaSpolu,C212_SadzbaDPHNizsia,C213_SadzbaDPHVyssia,C214_ZakladDPHNizsi,C215_ZakladDPHVyssi,C216_ZakladDPHNulovy,C217_ZakladDPHNeobsahuje,C218_SumaDPHNizsia,C219_SumaDPHVyssia,C220_Uhradene,C221_SumaSpoluNizsia,C222_SumaSpoluVyssia,C223_SumaSpoluZaevidovana,C224_Odpocitane,C225_UcetSynteticky,C226_UcetAnalyticky,C227_SumaSpoluZaevidovanaTM,C228_UhradeneTM,C229_OdpocitaneTM,C230_ZakladHalieroveVyrovnanie,C231_ZakladZaloha,C232_ZakladIny,C233_VzajomnyZapocetCM,C234_VzajomnyZapocetTM,C250_NezahrnutDoSaldokonta,C251_PouzityPDM,C252_NezahrnutDoPrechodu,C253_RokUzavierkyDPHUplatnenej,C235_SumaSpoluZaevidovanaTMHal,C056_PartnerDICPreCR,C144_HlasenieFO,C057_PartnerKodStatuDPH,C058_PartnerIDpreDPH,C013_IDEvidencieRG,C014_IDCisRadaRG,C015_IDEvidencieSP,C016_IDCisRadaSP,C017_CisloRG,C018_CisloSP,C059_TypPosty,C240_Mena3M,C241_MnozstvoJednotky3M,C242_KurzNBS3M,C079_UctovneObdobieRok,C038_KodSchvalil,C111_Schvalil,C112_Zauctoval,C027_KodZauctoval,C134_VytvorenyBlocek,C044_PartnerFirmaMeno,C254_PohladavkaZavazok,C101_MaPripojeneSubory,C145_CisloDokladuKVDPH,C146_VstupujeDoKVDPH,C147_CislaPovodnychDokladov,C084_DenDNT,C085_MesDNT,C086_RokDNT) VALUES (3011,0,0,0,0,293031505,5129,0,1,100,"OF","OF","OF","",2,"","FV1500110","FV1500110","","","","","","",0638,"Pi�iakov� Darin",44955758,0,1034493691,"","",21,01,2015,0,0,0,24,01,2015,21,01,2015,21,01,2015,2015,01,21,01,"16:51:12","16:51:12","","","","Tržby za predaný tovar",0,"","Žuffová Silvia",3,-1,-1,3,"",21,01,2015,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,"","","",0,"","EUR",1,1,0,118.45,118.45,10,20,0,98.71,0,0,0,19.74,0,0,118.45,118.45,0,311,001,118.45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"SK",1034493691,0,0,0,0,"","",0,"",0,0,2015,3,"Prošniak Božena Halina","Žuffová Silvia",2,0,"Pišiaková Darina - DROBČEK",0,0,"FV1500110",0,"",0,0,0);';
//very long SQL
        try{
            $dataPDO->quote($ex);
            $res=$dataPDO->query($ex);
        }
        catch(PDOException $e){
            echo $e->getMessage();
        }
// exception not caught
        if(!$res)print_r($dataPDO->errorInfo());

不幸的是,$res始终设置为false,错误为:

Array
(
    [0] => 07002
    [1] => -3010
    // it is not set to utf-8 
    [2] => [Microsoft][Ovl�da� ODBC Microsoft Access] Pr�li� m�lo parametrov. Predpoklad� sa 11. (SQLExecute[-3010] at ext\pdo_odbc\odbc_stmt.c:254)
    // translation: [Microsoft][Driver ODBC Microsoft Access] Too few parameters. Expected 11. (might be translation bug or does it really expect 11 parameters?
    [3] => 07002
)

0 个答案:

没有答案