|
when you say , "select * from myTable" its gonna return all the recordsets in your table. so you have them in a recordset set object, i.e:
_recordset rec;
rec->GetRecordCount()
Now open the Target database....
In a loop, till the recordcount()is reached
{
1.read the record, (xyz database)
2.insert in the target table (acess)
3.MoveNext (xyzdataBase)
}
close(xyz)
close(access)
the data is moved
VuNic
|
|
|
|
|
I wrote the following code:
CDatabase srcDb;
if (srcDb.Open(NULL))
{
m_sDbName = srcDb.GetConnect(); //m_sDbName is a variable of type CString
UpdateData(FALSE);
}
CRecordset rs(&srcDb);
CString strSQL;
strSQL = "SELECT * FROM table1";
rs.Open(CRecordset::snapshot, strSQL, CRecordset::readOnly);
rs.Close();
Everything works OK, (the database is connected), but when it gets to the row:
rs.Open(CRecordset::snapshot, strSQL, CRecordset::readOnly);
the application crashes, and I don't understand why...
Is this the right syntax for connecting to a database and retrieving data from a table? Could you maybe attach some source code, so I could compare?
Another question - after the row: rs.Open(CRecordset::snapshot, strSQL, CRecordset::readOnly); executes I should have the data from the table in the recordset object, right?
|
|
|
|
|
How do I layout components , to add new GUI componets , delete , re-position dynamically at runtime in MFC
|
|
|
|
|
First you create GUI components (usually derived from CWnd class) such as CButton by calling their Create() method. Then you can change their position using the SetWindowPos() method.
|
|
|
|
|
Hi,
i searched for function to change a string is in lower case in to upper case.
thanking you
|
|
|
|
|
If you are using CString then use MakeUpper and if you are using char* string then use toupper function.
thanx
danishjibbran
|
|
|
|
|
sheshidar wrote: i searched for function to change a string is in lower case in to upper case.
what was the result?
VuNic
|
|
|
|
|
CString="tEst";
test.MakeUpper(); // now its TEST
test.MakeLower(); // now its test
cheers
zoz
|
|
|
|
|
Hi all
can any one tell me how to retreive the parent of a child in a TreeStructure which is derived from CTreeCtrl in MFC
|
|
|
|
|
Use GetParentItem. It takes HTREEITEM type variable as only argument whoes parent is to be retrieved and return the parent as HTREEITEM if parent exists otherwise returns NULL.
danishjibbran
|
|
|
|
|
Good evening,
I am building an application for distribution that will need to access information stored in tables (i.e. records, fields, etc...), and even perform calculations and table joins. All the data and functionality needs to be contained within the application since the application will be used by customers of my friends' businesses. In other words, any data managing and storing capability needs to be fully contained within the application.
My question is, what type of strategy should I use (ADO, DAO, ODBC, OLE DB, etc...)? Or do I have to implement a database type file system (i.e. using vectors, multimaps, deques, etc...) myself?
Thanks for your help.
|
|
|
|
|
BlitzPackage wrote: any data managing and storing capability needs to be fully contained within the application.
Have a look at http://www.sqlite.org[^] for a decent embedded DB. I have only used it for small data sets but it came highly recommended.
http://www.codeproject.com/info/search.asp?target=sqlite&st=kw&qm=all[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks, I appreciate the information.
|
|
|
|
|
Hi all.
I want to make my own control. with out using MFC and window standard library.
i have made MyBtn class with all necessarary function. but i want to know how to get message when user click on it. i use BtnProc (...) but it does not work.
will some one help me. how to make event with callback on my own Control class.
thanks for help.
Amrit
|
|
|
|
|
did you register the class for the btn window ?
-Prakash
|
|
|
|
|
OOps Nope,
can i get any sample source for it.
what are the steps for doing all.
thanks for reply.
Amrit
|
|
|
|
|
Well in your win32 application there must be a call to to registerclass to register your main window.
That is how you register a class,
but if you are writting your own button, i would prefer to subclass the windowclass that windows has defined, that way you can also use the Dialog editor to design your UI.
Just my thoughts,
I have not done like this before but i think that should work.
check here[^] for system classes
-Prakash
|
|
|
|
|
Thank you once again for reply.
to register do we need windows class or we can use our own class (with does not have any member of windows)
thanks
Amrit
|
|
|
|
|
you need to provide a new class name when you register.
-Prakash
|
|
|
|
|
Thank You Prakash
I will Try.
by the way i was wandering for example.
Thanks
Amrit
|
|
|
|
|
Sorry i dont any at the moment for win32 implementation of a custom control. But should not be too difficult if tried.
|
|
|
|
|
I am interested in extracting the edges from the gray scale images.
Presently i m trying to work with sobel. But if any one can suggest the appropriate filters which i can use for my edge detection algorithm. Is the hough transformation helpful? Please also suggest me some libraries if already exist.
Senthil
India
|
|
|
|
|
Senthilgeo wrote: Is the hough transformation helpful?
You need to be more specific about what your looking for. If you are looking to convert image to edges, then look elsewhere.
Senthilgeo wrote: Please also suggest me some libraries if already exist.
There are code snippets out there that do Sobel, and there are whole libraries that do computer vision. If you are into Matlab, there are toolboxs that are devoted to this. In the end it depends on how you have your data setup and how you want it to fit in your project.
Quran
Lectures (updated 1/3/06)
"They are MUSLIM. It does not matter how you split it up: all msulims (so they say) see every other muslim as a brother, regardless of origin or nationality." -legalAlien. Alhamdullah for the blessing of Islam
|
|
|
|
|
Actually, the project i am trying to do is planar extraction from greyscale images for 3D modeling using C++. For computing the edge, i tried with Sobel Gradient. For line generation, i thought of using hough transformation, are there any libraries available? do u have any other suggestions or alternatives for hough transformatio
|
|
|
|
|
Ok I think I misunderstood you the first time. After you get the edges you can use Hough transform to find the different line segments. It should be very easy to implement. It also should be easy to restrict by lines of certain lengths.
Senthilgeo wrote: are there any libraries available?
Again there are a couple depending on what you are looking for. Intel has a popular one [opencv, though when I used it a good while back I had issues with some aspects of it]. There are many that perform single or a class of algorithims, one of which was posted below this: Chris's reply. The reason I am not recommending a specific implementation of an algorithim, is because unless you use a whole library like opencv, the data structures you use will likely be different from the one in the implementation, and it would be easier to do yourself at that point [there are many implmentations you can look at by googling to get a starting idea].
Quran
Lectures (updated 1/3/06)
"They are MUSLIM. It does not matter how you split it up: all msulims (so they say) see every other muslim as a brother, regardless of origin or nationality." -legalAlien. Alhamdullah for the blessing of Islam
-- modified at 14:35 Sunday 29th January, 2006
|
|
|
|