Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am implementing Project in vc++ 12. back-end is access database. I want to select all four columns values in one row into four variable. How to do that in vc++ 12. I know how to select complete table or single column into listbox control but now I want to select those four into four variable.


Please Help.
Posted
Comments
Richard MacCutchan 7-Jan-16 9:12am    
You need to show the code where you do the select, so we can see how you are getting the variables from the database.
Kishor-KW 7-Jan-16 22:53pm    
Variable are in code only,data from database is get selected/ stored into those variable.

m_txt = "select CompanyName As m_CompanyName, Model As m_Model, OrderNo As m_OrderNo, StreetAddress As m_StreetAddress , Phone As m_Phone, Logo As lg1 from Companies and I also want to get know how to specify where clause here as

m_txt = "select CompanyName As m_CompanyName, Model As m_Model, OrderNo As m_OrderNo, StreetAddress As m_StreetAddress , Phone As m_Phone, Logo As lg1 from Companies where CompanyName="+s1; (thats how we write query in MySql or Sql server, s1 is variable of string type)
but in vc++ at + sign it gives error.
Richard MacCutchan 8-Jan-16 3:48am    
but in vc++ at + sign it gives error.
Because that is not valid C/C++ syntax. I would suggest looking at Data Access in Visual C++.
Kishor-KW 8-Jan-16 4:00am    
Please specify one example @Richard MacCutchan
Richard MacCutchan 8-Jan-16 4:37am    
Example of what? If you do not know C++, and you do not know SQL, then you have quite a way to go to solve this issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900