May 24, 2022, 03:23:54 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


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