Hi im triying to get somethings from mysql and generated and email from then so this is the problem now
Dim rs as RecordSet
rs = ibssts.SQLSelect( “SELECT NombreCorto, Correo FROM usuarios WHERE NoTarjeta =”+NoTarjetaGlobal)
Dim NombreCorto As String
Dim Correo As String
If rs <> Nil and rs.EOF = False then
// Create the actual email message
Dim mail As New EmailMessage
mail.FromAddress = “test@ibss.com.do”
mail.Subject = " Nuevo Inicio de Seccion en su Tarjeta Numero: "+TXT_Tarjeta.Text
mail.BodyPlainText = “Hola “+NombreCorto +” Hemos detectado un inicio de seccion en la plataforma de INTERBYSS con su tarjeta numero:”+TXT_Tarjeta.Text
mail.Headers.AppendHeader(“X-Mailer”, “IBSS Tehnichal Services”) // Sample header
mail.AddRecipient(Correo)
// Add the message to the SMTPSocket and send it
SendMailSocket.Messages.Append(mail)
SendMailSocket.SendMail
the sql do the query but dont receive anything with this and i cant fill the Correo Variable or NombreCorto for send the email because that do nothing
Dim rs as RecordSet
Dim NombreCorto As String
Dim Correo As String
rs = ibssts.SQLSelect( "SELECT NombreCorto, Correo FROM usuarios WHERE NoTarjeta ="+NoTarjetaGlobal)
if ibssts.error=false then
If rs.EOF = False then // no need to check for NIL, as this will occur only if there is an ERROR
NombreCorto = rs.Field ("NombreCorto").stringvalue
Correo = rs.Field("Correo").stringvalue
End if
rs.close
else
msgbox "YOU HAD AN ERROR IN YOUR QUERY... "+db.errormessage
return
end if
this is off the top of my head, but you NEED to check for errors… NOT RS=nil,
Why is everyone so fixated on RS=NIL?
RS will ONLY be nil if the SQL is malformed, in which case the DB will have an error, which you need to check as it is the only method to help determine WHY it is malformed.
ok… one other situation where RS would be NIL… and that is if you never execute the statement at all