March 28, 2024, 04:22:35 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


SQL hint

Started by Bruce Peaslee, September 30, 2010, 10:15:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

I have started putting the SQL statement into a separate string like this:

sSQL = "INSERT INTO Sales (nLot, sMonth, sDay, sYear, fAmount, sNote) " +_
"VALUES (" + sLotNumber + ", '" + sMonth + "', '" + sDay + "', '" + sYear + "', " + sTemp + ", '" + sNote + "')"
dbExecuteSQL(pDB, sSQL)


Not only does it make it easier to read, but you can pop the string into a message box to see exactly what the database engine is getting.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

I too have used that technique before because it aids in troubleshooting.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library