FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Dataset not in edit or insert mode
Buenas a todos, mi problema es el siguiente:
Trabajo con c++ Builder 6 y Access 2007 Mi aplicación se encarga de cargar un archivo .csv en un StringGrid mediante un boton al que llamo Importar, hasta ahi todo bien, una vez cargado este archivo, intento que los datos de este StringGrid se guarden en la base de datos que tengo en acces lo hago de la siguiente forma: Código:
XDatos->TCategorias->Open(); XDatos->TSubCat1->Open(); XDatos->TSubCat2->Open(); XDatos->TSubCat3->Open(); XDatos->TMarcas->Open(); XDatos->TCaracteristicas->Open(); for (int f=1;f<=StringGrid1->RowCount;f++) { if (StringGrid1->Cells[0][f]!="") { XDatos->QProductos->Append(); XDatos->QProductosREFERENCIA->Value = StringGrid1->Cells[0][f]; XDatos->QProductosESTADO->Value = StringGrid1->Cells[1][f]; //XDatos->QProductosCATEGORIA->Value = StringGrid1->Cells[2][f]; bool esta=false; while(!XDatos->TCategorias->Eof) { if (StringGrid1->Cells[2][f] == XDatos->TCategoriasCATEGORIA->Value) { XDatos->QProductosCATEGORIA->Value=XDatos->TCategoriasCodCategoria->Value; esta=true; } XDatos->TCategorias->Next(); } if (!esta) { XDatos->TCategorias->Append(); XDatos->TCategoriasCATEGORIA->Value = StringGrid1->Cells[2][f]; XDatos->QProductosCATEGORIA->Value=XDatos->TCategoriasCodCategoria->Value; XDatos->TCategorias->Post(); } //XDatos->QProductosSUBCAT1->Value = StringGrid1->Cells[3][f]; esta=false; while(!XDatos->TSubCat1->Eof) { if (XDatos->TSubCat1CATEGORIA->Value == XDatos->QProductosCATEGORIA->Value && XDatos->TSubCat1SUBCAT1->Value == StringGrid1->Cells[3][f]) { XDatos->QProductosSUBCAT1->Value= XDatos->TSubCat1CodSUBCAT1->Value; esta=true; } XDatos->TSubCat1->Next(); } if (!esta) { //XDatos->TSubCat1CodSUBCAT1->Value = XDatos->QProductosSUBCAT1->Value; XDatos->TSubCat1->Append(); XDatos->TSubCat1SUBCAT1->Value = StringGrid1->Cells[3][f]; XDatos->TSubCat1CATEGORIA->Value = XDatos->QProductosCATEGORIA->Value; XDatos->QProductosSUBCAT1->Value= XDatos->TSubCat1CodSUBCAT1->Value; XDatos->TSubCat1->Post(); } //XDatos->QProductosSUBCAT2->Value = StringGrid1->Cells[4][f]; esta=false; while(!XDatos->TSubCat2->Eof) { if (XDatos->TSubCat2SUBCAT1->Value == XDatos->QProductosSUBCAT1->Value && XDatos->TSubCat2SUBCAT2->Value == StringGrid1->Cells[4][f]) { XDatos->QProductosSUBCAT2->Value = XDatos->TSubCat2CodSUBCAT2->Value; esta=true; } XDatos->TSubCat2->Next(); } if (!esta) { //XDatos->TSubCat2CodSUBCAT2->Value = XDatos->QProductosSUBCAT2->Value; XDatos->TSubCat2->Append(); XDatos->TSubCat2SUBCAT2->Value = StringGrid1->Cells[4][f]; XDatos->TSubCat2SUBCAT1->Value = XDatos->QProductosSUBCAT1->Value; XDatos->QProductosSUBCAT2->Value = XDatos->TSubCat2CodSUBCAT2->Value; XDatos->TSubCat2->Post(); } //XDatos->QProductosSUBCAT3->Value = StringGrid1->Cells[5][f]; esta=false; while(!XDatos->TSubCat3->Eof) { if (XDatos->TSubCat3SUBCAT2->Value == XDatos->QProductosSUBCAT2->Value && XDatos->TSubCat3SUBCAT3->Value == StringGrid1->Cells[5][f]) { XDatos->QProductosSUBCAT3->Value = XDatos->TSubCat3CodSUBCAT3->Value; esta=true; } XDatos->TSubCat3->Next(); } if (!esta) { //XDatos->TSubCat3CodSUBCAT3->Value = XDatos->QProductosSUBCAT3->Value; XDatos->TSubCat3->Append(); XDatos->TSubCat3SUBCAT3->Value = StringGrid1->Cells[5][f]; XDatos->TSubCat3SUBCAT2->Value = XDatos->QProductosSUBCAT2->Value; XDatos->QProductosSUBCAT3->Value = XDatos->TSubCat3CodSUBCAT3->Value; XDatos->TSubCat3->Post(); } XDatos->QProductosPRODUCTO->Value = StringGrid1->Cells[6][f]; XDatos->QProductosKEY->Value = StringGrid1->Cells[7][f]; XDatos->QProductosMARCA->Value = StringGrid1->Cells[8][f]; esta=false; while(!XDatos->TMarcas->Eof) { if (XDatos->TMarcasMARCA->Value == XDatos->QProductosMARCA->Value) esta=true; XDatos->TMarcas->Next(); } if (!esta) { XDatos->TMarcas->Append(); XDatos->TMarcasMARCA->Value = XDatos->QProductosMARCA->Value; XDatos->TMarcas->Post(); } XDatos->QProductosDESCRIPCION->Value = StringGrid1->Cells[9][f]; XDatos->QProductosCATEGORIAX->Value = StringGrid1->Cells[10][f]; XDatos->QProductosCATEGORIAS->Value = StringGrid1->Cells[11][f]; XDatos->QProductos->Post(); for(int c=12;c<=StringGrid1->ColCount;c++) { if (StringGrid1->Cells[c][f]!="") { XDatos->TCaracteristicas->Append(); XDatos->TCaracteristicasLuCATEGORIA->Value = StringGrid1->Cells[2][f]; XDatos->TCaracteristicasLuSUBCAT1->Value = StringGrid1->Cells[3][f]; XDatos->TCaracteristicasLuSUBCAT2->Value = StringGrid1->Cells[4][f]; XDatos->TCaracteristicasLuSUBCAT3->Value = StringGrid1->Cells[5][f]; XDatos->TCaracteristicasref->Value = StringGrid1->Cells[0][f]; if (c % 2 ==0) XDatos->TCaracteristicasCARACTERISTICA->Value = StringGrid1->Cells[c][f]; else XDatos->TCaracteristicasVALOR->Value = StringGrid1->Cells[c][f]; XDatos->TCaracteristicas->Post(); } } } } XDatos->TCategoria->Append();. Espero que haya quedado claro el problema, si alguien tiene alguna idea sobre que puede pasar, o a alguien le ha pasado algo parecido agradecería la ayuda. Gracias de ante mano. |
#2
|
||||
|
||||
Mira si te sirve algunos de los enlaces del final de esta misma página
|
#3
|
|||
|
|||
Gracias
Gracias cuando busque en el foro no encontre esos temas
|
#4
|
||||
|
||||
Cita:
Código:
XDatos->TCategoria->State = dsEdit; XDatos->TCategoria->Append() Saludos
__________________
Nunca esta de más volver a ver la "Guia de Estilo" o "La Otra Guia de Estilo". Recuerda siempre usar los "Tags" para una mejor legibilidad de tu código. Cuando miras fijamente al abismo, este te devuelve la mirada oo______ooo_____ooo_ooooooo_____ooo____oooooo____ooooooo______oooo____ooo____oo_ oo______oooo___oooo_oo____oo__oo___oo__oo____oo__oo____oo___oo____oo__oooo___oo_ oo______oo_oo_oo_oo_oo____oo_oo_____oo_oo_____oo_oo____oo__oo______oo_oo_oo__oo_ oo______oo__ooo__oo_oooooo___ooooooooo_oo_____oo_ooooooo___oo______oo_oo__oo_oo_ oo______oo_______oo_oo_______oo_____oo_oo____oo__oo____oo___oo____oo__oo___oooo_ ooooooo_oo_______oo_oo_______oo_____oo_oooooo____oo_____oo____oooo____oo____ooo_ ________________________________________________________________________________ |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Error "DatAset not in edit or intert mode" ESTANDO EN MODO INSERT!!! | Lenny | Varios | 17 | 24-05-2011 20:16:34 |
DataSet not in edit or insert mode | Mystery | Varios | 2 | 09-06-2010 17:40:17 |
Dataset not in edit or insert Mode | radge | OOP | 1 | 10-06-2008 15:46:32 |
Dataset not in edit or insert mode :S si esta en append! | Mannu | C++ Builder | 1 | 28-11-2007 09:52:18 |
ayuda novata: "Dataset not in Edit or Insert mode" | maquicu | Tablas planas | 1 | 05-06-2004 09:40:27 |
|