Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


C++ sql

mallixmallix Member Posts: 1

after a lot of search i think its time to ask some questions arround.

So this is how it goes.
I have built a database in Ms Access.
There i have a table called Cd_Customer which also has a cell called Employee type: integer.
I also built a program in C++ which controls all data.
I have a problem thought.

lets say i have a string like this:
string sqlString = "SELECT * FROM Cd_Customer Where Cd_Customer.Employee = '" + id + "' ";

Id passes through my function correctly and is an integer, so i get an error in compilation saying: "Invalid pointer addition".

if i declare id as a string of course there s no error but there are no results in my form also.
If i declare in database cell Employee as text and build my query like this:
string sqlString = "SELECT * FROM Cd_Customer WHERE Cd_Customer.Employee = 128";
i get results, but i need that Employee as an integer cause its a foreign key from another table.

So, what should i do with my query to have results passing integer as parameter through variable id, to be ok with the cell Employee from database wich is also integer.
Any ideas? I would really appreciate some help here.

Sign In or Register to comment.