On 06 Mar 2007 07:19:36 -0800, Tyro <[EMAIL PROTECTED]> wrote:
>
> Hi,
>  I have made changes to the code as said by you and have also changed the
>  Data base from MS SQL to MS Access( because the former one asks for a
>  password authentication).I'm able to retrieve the database
>  using select statement without any problems but while inserting i needed to
>  use sprintf to copy the variables
>  on to the array. However, i'm not able to use a string or a character
>  variable inside an insert statement as shown in the code below.Is there any
>  other way to go about it

Yes, there is, it's called stringstreams. You need to include
<sstream>, and you can do things like:

char c = 'k';
int z = 100;
double d = 3.14;
stringstream ss;
ss << "Here's the char: " << c << ", now the int: " << z << ", and
finally the double " << d;

Then you access the string with ss.str (), or if you need to use it
for a legacy function that only accepts c-style strings you call
ss.str ().c_str ().


-- 
Tamas Marki

Reply via email to