• Sábado 27 de Abril de 2024, 13:44

Autor Tema:  Otra De Sentencia Sql  (Leído 1452 veces)

FREELANCE

  • Nuevo Miembro
  • *
  • Mensajes: 9
    • Ver Perfil
Otra De Sentencia Sql
« en: Lunes 7 de Mayo de 2007, 20:17 »
0
tengo una senetencia ssql que es muy larga, como le puedo hacer para ponerlo en varias lineas, gracias por las respuesta

RadicalEd

  • Moderador
  • ******
  • Mensajes: 2430
  • Nacionalidad: co
    • Ver Perfil
Re: Otra De Sentencia Sql
« Respuesta #1 en: Lunes 7 de Mayo de 2007, 20:19 »
0
Código: Text
  1. "Para cada línea" & vbCrLf & _
  2. "escrita la puedes" & vbCrLf & _
  3. "poner de esta forma"
  4.  
El pasado son solo recuerdos, el futuro son solo sueños

FREELANCE

  • Nuevo Miembro
  • *
  • Mensajes: 9
    • Ver Perfil
Re: Otra De Sentencia Sql
« Respuesta #2 en: Lunes 7 de Mayo de 2007, 20:43 »
0
ya lo coloque pero la segunda linea me sale error, quiza lo aplique mal, explicame con mas detalle por favor, de antemano muchas gracias

Ssql = "INSERT INTO tpm (equipo, operador, hor_inicial, & vbCrLf & _
 hor_final, fecha, turno, seccion, aceite_mot, aceite_hid, aceite_tra, & vbCrLf & _
 petroleo, obs_general, cod_1, inic_1, fin_1, observ_1, cod_2, inic_2, fin_2, observ_2,& vbCrLf & _
 cod_3, inic_3, fin_3, observ_3, cod_4, inic_4, fin_4, observ_4, cod_5, inic_5, fin_5, observ_5,& vbCrLf & _
 cod_6, inic_6, fin_6, observ_6, cod_7, inic_7, fin_7, observ_7, cod_8, inic_8, fin_8, observ_8, cod_9, inic_9, & vbCrLf & _
 fin_9, observ_9, cod_10, inic_10, fin_10, observ_10, cod_11, inic_11, fin_11, observ_11, cod_12, inic_12,  & vbCrLf & _
 fin_12, observ_12) VALUES ('" & Combo1.Text & "','" & Combo2.Text & "','" & Text1.Text & "','" & Text2.Text & "',& vbCrLf & _
 '" & Text3.Text & "','" & turno & "','" & Combo3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "',& vbCrLf & _
 '" & Text7.Text & "','" & Text8.Text & "','" & combo4.Text & "','" & Text9.Text & "','" & Text10.Text & "','" & Text11.Text & "', & vbCrLf & _
 '" & combo5.Text & "','" & Text12.Text & "','" & Text13.Text & "','" & Text14.Text & "','" & combo6.Text & "', & vbCrLf & _
 '" & Text15.Text & "','" & Text16.Text & "','" & Text17.Text & "', '" & combo7.Text & "','" & Text18.Text & "', & vbCrLf & _
 '" & Text19.Text & "','" & Text20.Text & "', '" & combo8.Text & "','" & Text21.Text & "','" & Text22.Text & "', & vbCrLf & _
 '" & Text23.Text & "', '" & combo9.Text & "','" & Text24.Text & "','" & Text25.Text & "','" & Text26.Text & "', & vbCrLf & _
 '" & combo10.Text & "','" & Text27.Text & "','" & Text28.Text & "','" & Text29.Text & "', '" & combo11.Text & "',& vbCrLf & _
 '" & Text30.Text & "','" & Text31.Text & "','" & Text32.Text & "', '" & combo12.Text & "','" & Text33.Text & "', & vbCrLf & _
 '" & Text34.Text & "','" & Text35.Text & "','" & combo13.Text & "','" & Text36.Text & "','" & Text37.Text & "', & vbCrLf & _
 '" & Text38.Text & "','" & combo14.Text & "','" & Text39.Text & "','" & Text40.Text & "','" & Text41.Text & "', & vbCrLf & _
 '" & combo15.Text & "','" & Text42.Text & "','" & Text43.Text & "','" & Text44.Text & "')"

RadicalEd

  • Moderador
  • ******
  • Mensajes: 2430
  • Nacionalidad: co
    • Ver Perfil
Re: Otra De Sentencia Sql
« Respuesta #3 en: Lunes 7 de Mayo de 2007, 22:07 »
0
Te fijastes como se abren y cierran comillas no ;)
Código: Text
  1. Ssql = "INSERT INTO tpm (equipo, operador, hor_inicial," &  _
  2. "hor_final, fecha, turno, seccion, aceite_mot, aceite_hid, aceite_tra," & _
  3. "petroleo, obs_general, cod_1, inic_1, fin_1, observ_1, cod_2, inic_2, fin_2, observ_2," & _
  4. "cod_3, inic_3, fin_3, observ_3, cod_4, inic_4, fin_4, observ_4, cod_5, inic_5, fin_5, observ_5," &  _
  5.  
  6.  
Así no mas te da. etc, etc, etc.
El pasado son solo recuerdos, el futuro son solo sueños