Data Access

Buying Data for Improved Investment Decisions

Investing is tricky. Everyone from experienced retail investors to venture capital professionals will tell you that there are loads of variables to consider. You need to understand the market and know everything about the company to be able to correctly evaluate the stock. One way to enable yourself to do

Detecting Alphabetic Data

Question: How do you detect alphabetic data being entered into an integer field from a cin statement? Answer: The easiest way to do that is by having cin read a string rather than an int. Then you can examine the string to detect its validity. For example: #include #include using

Wide Character Literals

A string literal is a sequence of one or more characters enclosed in double quotes: cout

Sizeof or strlen()?

What’s wrong with the following code excerpt? const char name[] = “john doe”; //9 characters, null char implicitly added by compilersize_t namesz = strlen(name); //namesz equals 8! Nothing, in fact. Code like this does exist and is perfectly legal. However, it’s inefficient and error prone: the standard strlen function computes

Delphi SQL Parameters

Question: Is it possible to use a parameter on the left side of an equality in a WHERE clause? For example: SELECT * FROM TblName WHERE:parm1 = :parm2 When I do this, the results I get suggest that every record passes the equality test, which shouldn’t be the case. Thank

Using variable in SQL WHERE clause

Question: How can I use the contents of a text box as the WHERE clause in a SQL query? “SELECT * FROM Table WHERE Field = Text1.Text” doesn’t work. Answer: The SQL parser is expecting a string of the form: SELECT * FROM Table WHERE Field = ‘Value’ if ‘Field’