|
At 9:00am CT I sent the files, including the db. Please acknowledge recieving it, sometimes I don't get notification that the mail sent failed.
Thanks
A C++ programming language novice, but striving to learn
|
|
|
|
|
So how do I update, delete, write to the database? Do I have to make a recordset for each table? That sounds very strange.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: Do I have to make a recordset for each table?
Yes, or you can do it via CDatabase::ExecuteSQL() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David,
What my intentions are, is that when the User creates a "Recipe" that I will write the record of that recipe to the database under the "Recipe" table. The [Recipe].[MealPlan] varable will tell me when loading the Recipe Meal Plan for viewing a User plan for a Meal(ie, Special Occassion Meal= Birthday Party, Wedding, etc. (see uploaded new "CookIt.mdb" db)
There is a Funtion in my program where the User selects ingredients and recipes they will use in developing a "Meal Plan" for a "Special Occassion Meal Plan". All Ingredients, upon User selections, are linked by the "MealPlanName", so that when the User selects a "MealPlan" from a list control that "MealPlan" is loaded. This works fine with my ".xml" database; I was trying to do the same thing with the MS Access DB. How would you go forth in accomplishing this with a MS Access DB?
I redid the CRecordset (dsn) to only include the "Recipe" table. It doesn't give any erros, it goes through the AddNew() and then at UpDate() it clears the fields and no record is written to the db.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hi everybody,
What is the entry point for Message Mapping?
thid question was asked in some interview.
Thanks
msr
|
|
|
|
|
The interviewer was probably thing about the BEGIN_MESSAGE_MAP macro.
|
|
|
|
|
|
Hi,
im using vector<string> strvector. it works in unix but when i run in Dev c++, it prompt me error like no matching function for call tp `Vector`.....etcc
why is this so??
|
|
|
|
|
1. Show your code.
2. Show the exact error message that the compiler issued.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
#include <vector>
using namespace std;
vector<string> vectorstr ;
....
vectorstr.push_back("....")
...
for(int i=0;i<this->vectorstr.size(); i++){
cout << "test:" << this->vectorstr.at(i) << endl;
}
...
void removeduplicates(vector<string>& vec){
sort(vec.begin(), vec.end());
vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
i have been getting error like:
implicit declaration of function int sort
implicit declaration of function int unique
no matching function for call to vector<basic_string....
<div="" class="ForumMod">modified on Sunday, November 29, 2009 12:55 PM
|
|
|
|
|
nuttynibbles wrote: #include
That doesn't help, does that? Which headers are you including? I suspect that you're missing something. Most probably #include <string>
Uncheck the "Encode HTML tags when pasting", paste your code into the window, and ensure your code snippet is within a pre block (selecting the "Code Block" option, which you've already done).
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
i have these headers
#include <iostream>
#include <sstream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <map>
#include <vector>
using namespace std;
|
|
|
|
|
I think you should #include<algorithm> to use sort.
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
Hi sarath,
tks. i included #include <algorithm> and the error message on sort is no more. however, the error on "no matching function for call to `vector...." is still there.
im pretty sure i use the vector correctly. the error is at the line:
cout << this->vector.at(i) << endl;
|
|
|
|
|
Could you please post the full and exact error message ?
|
|
|
|
|
The following piece of code (basically yours...) runs fine on my system (WinXP , Visual Studio 2005 ):
#include <string>
#include <vector>
#include <iostream>
using namespace std;
void main()
{
vector<string> vectorstr;
vectorstr.push_back("....");
for(int i=0;i<vectorstr.size(); i++)
{
cout << "test:" << vectorstr.at(i) << endl;
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think the char* is not automatically deduced from the string class. Please try the following code.
cout << this->vector.at(i).c_str() << endl;
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
You keep giving showing your code in bits and pieces. It's very difficult to help you. However, it appears that you're trying to sort a vector such that there are only unique elements. See if this helps:
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void UniqueSort(std::vector<string>& MyVec)
{
sort(MyVec.begin(), MyVec.end());
MyVec.erase(unique(MyVec.begin(), MyVec.end()), MyVec.end());
}
int _tmain()
{
vector<string> vec;
vec.push_back("one");
vec.push_back("two");
vec.push_back("one");
vec.push_back("four");
vec.push_back("five");
vec.push_back("six");
vec.push_back("seven");
vec.push_back("eight");
vec.push_back("six");
int nSize = vec.size();
UniqueSort(vec);
nSize = vec.size();
return 0;
}
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi all !
I'm writing an MFC application that runs as a Windows Service.
I want the application to be notified when a user logs-in or when a user logs-out in order to display icon in the task bar.
How can it be done ?
Thanks all,
Amit c.
|
|
|
|
|
Take a look at this article - http://www.codeproject.com/KB/system/winlogon_notification_package.aspx
|
|
|
|
|
Hello guys im trying to create an application that uses the hand after i insert the header and cpp files in the application the following error messsage comes up when i try to build the application.
Error 3 error LNK2019: unresolved external symbol _sqlite_freemem referenced in function "public: __thiscall CppSQLiteException::CppSQLiteException(int,char *,bool)" (??0CppSQLiteException@@QAE@HPAD_N@Z) CppSQLite.obj PasswordManager
Why is this happening guys? can anyone help me. And btw I am new a C++ just to let you know.
|
|
|
|
|
Sorry guys had a typo there, here is the actual post:
Hello guys im trying to create an application that uses CppSQLiteWrapper and after i insert the header and cpp files in the application the following error messsage comes up when i try to build the application.
Error 3 error LNK2019: unresolved external symbol _sqlite_freemem referenced in function "public: __thiscall CppSQLiteException::CppSQLiteException(int,char *,bool)" (??0CppSQLiteException@@QAE@HPAD_N@Z) CppSQLite.obj PasswordManager
Why is this happening guys? can anyone help me. And btw I am new a C++ just to let you know.
|
|
|
|
|
cdpace wrote: unresolved external symbol _sqlite_freemem
This indicates that either you have spelt this function name wrongly, or the libary that includes the function has not been added to your project. Check that you have added all the pre-requisites for CppSQLiteWrapper . I don't know where you got this code from but it may be quicker if you go back to the source and ask your question there.
|
|
|
|
|
Hi,
I understand we can concat strings using + operator. for example,
string strarray[20];<br />
string rule= "1 ";<br />
string word = "; hello world";<br />
for(int i=0;i<10;i++){<br />
strarray[i] = rule + word;<br /> }
however if i do this, it prompt an error:
<br />
string strarray[20];<br />
for(int i=0;i<10;i++){<br />
strarray[i] = "Rule " + "; hello world";<br />
}<br />
how do i go about doing this? tks
|
|
|
|
|
nuttynibbles wrote: strarray[i] = "Rule " + "; hello world";
Because in that case you try to concatenate char arrays, not std::string. Thus, there's no + operator overloading for char arrays. The + operator is overloaded by the string object, so it means the left operand of the + has to be a string, not a char array.
|
|
|
|