|
I need my program to view data from a .dbf file but I don't want to have to use a DBMS to do so. How would I go about doing this?
Parse the file myself?
Or is their a better way?
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
If you are not interested in using a DBMS, then your only recourse is to process the file yourself, not a trivial task by any means. See here, here and here for file format information.
Why not use ODBC? Create a DSN using the ODBC applet in Control Panel. Then you can use the CRecordset class to access the data. You can also create a DSN-less connection.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
This is my first experience with a database of any sort...
My program only needs to update data from a .dbf from a cd once a month, so it doesn't have to be efficient, and no writing is needed either. I cannot distribute any software with my hardware that is not already installed on windows, for example Microsoft Access, etc.
If I use ODBC, (I know very little about it now) would my program be able to access the file without having to distribute a DBMS along with my own software?
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
kshaff03 wrote:
...and no writing is needed either.
If no writing is needed, then how are you going to update the .dbf file?
kshaff03 wrote:
I cannot distribute any software with my hardware that is not already installed on windows, for example Microsoft Access, etc.
Most drivers come preinstalled with the OS.
kshaff03 wrote:
If I use ODBC, (I know very little about it now) would my program be able to access the file without having to distribute a DBMS along with my own software?
Most likely, yes. Newer technologies exist (e.g., ADO, DAO), but I've not had the privilege of using them. One of these days I'll give 'em a whirl, though.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_database_topics_.28.odbc.29.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcodbc_drivers_overview.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/dasdkodbcoverview.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;110093
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow wrote:
If no writing is needed, then how are you going to update the .dbf file?
Actually, I am updating a text file on the harddrive with a subscription from a cd that contains a .dbf file with the data I need.
Thank you very much for all your help and advice. I was under the impression that you would have to buy Access and have it installed in order for your program to use the drivers. I guess it is time to learn some database programming!
Thanks again.
Kevin Shaffer
kshaff03@msn.com
|
|
|
|
|
kshaff03 wrote:
I was under the impression that you would have to buy Access and have it installed in order for your program to use the drivers.
With some databases, this might be the case, but not with Access.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi
When i send my request using CHttpConnection to the server using the POST method my "+" sign is replaced by blank space. I am sending the header as
Content-Type: application/x-www-form-urlencoded\r\n
can any body help me in this what type of header i should send so that it won't replace the "+" sign .
Thanks
shailesh
|
|
|
|
|
You need to URLEncode the +, because in a URL, + is a synonym for a blank space.
You should replace your + with %2B.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
|
|
Hi,
I m using CRichEditCtrl in a Dialogbox, How can I capture the Lost Focus event of CRichEditCtrl.
|
|
|
|
|
Does OnKillFocus() not work?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks for replying
No, OnKillFocus() is not working.
Actually wat i have done is create a subclass of CRichEditCtrl and that i have included in the Dialog that facilitates me to capture KeyPress event.
The code snippet is sumthing like this:
BOOL CSend::PreTranslateMessage(MSG* pMsg)
{
extern char userStatus[50];
if (pMsg->message == WM_KEYDOWN)
strcpy(this->userStatus,"Typing");
return CRichEditCtrl::PreTranslateMessage(pMsg);
}
but , then i have find out that Lost Focus is Mouse event and that cannot be handled using abouve snippet so i have tried a different this which is as follows:
BOOL CChat::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
NMHDR* pNMHDR = (NMHDR *)lParam;
if(pNMHDR && pNMHDR->code == NM_KILLFOCUS)
{
CWnd *pFocus = CWnd::GetFocus(); // call to a static function
if(pFocus &&(pFocus->GetParent() == this))
{
if(pFocus->GetDlgCtrlID() == TXT_SEND)
MessageBox("here",NULL,MB_OK);
}
}
return CDialog::OnNotify(wParam, lParam, pResult);
}
OR
BOOL CChat::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
UINT notificationCode = (UINT) HIWORD(wParam);
return CDialog::OnCommand(wParam, lParam);
}
But stll unable 2 capture lost focus event of CRichEditCtrl.
|
|
|
|
|
See if CRichEditCtrl::SetEventMask(ENM_MOUSEEVENTS | ENM_KEYEVENTS) is of any use?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Sorry, this is not solving the problem. Pls suggest me some other solution.
|
|
|
|
|
I am using Microsoft Flexgrid 6.0 in my application.
however when I try to maximize the application window , flexgrid does not get expanded in proportion to expansion and looks ugly.
any idea of setting up flexgrid such that it will expand according to the boundries of window in which it is embeded.
thanks
sanjay
|
|
|
|
|
Handle the WM_SIZE message for the parent window, and call MoveWindow on the control to resize the FlexGrid.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Dear all,
What is the simplest way to change the font size of an edit control? For ex., to change from 8 pt to 10 pt.
Thanks.
BRs.
____
Tuan
|
|
|
|
|
Assuming that this is a dialog project, call CEdit::SetFont() in the dialog's OnInitDialog() method. You'll first need to create a font, presumably with a CFont object that belongs to the dialog itself.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks so much, David. Is that the simplest and fastest way?
____
Tuan
|
|
|
|
|
Yes. I think you can also do it in the resource editor, but that might force you to change the font for the entire dialog page in question, and you might not want to do that.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Tuan Dang wrote:
Is that the simplest...
If by "simple" you mean "shortest," then I would have to say yes.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hi,
I am making an SDI program that needs to switch between "2 panes on the left, 1 on the right" and "1 left, 1 right"
I'm creating the 2 left panes by nesting a CreateStatic in another Splitter. (I make my CreateStatic calls from OnCreateClient) My idea is to somehow (after OnCreateClient) change the nested splitter from 2 rows to just one.
** My question is this: Is there a way I can Redefine my nested splitter and change the number of rows that it displays?
If there is a simpler way to solve this problem please let me know. I have looked at the splitter classes here on CP, but they seem to offer a lot of features that i don't want/need, and if a simpler solution exists I would prefer that.
Thanks.
Mike
"I bet Einstein turned himself all sorts of colors before he invented the light bulb." -- Homer J.
|
|
|
|
|
I've recently been through this process with an application of mine. The key to managing the content of splitter windows is the dialog control ID and parent window assigned to the windows in the splitter panes.
CSplitterWnd requires that the windows that occupy each pane be child windows of the splitter, and have the control ID returned by the CSplitterWnd function IdFromRowCol(int row,int col) . This function returns the control ID required for a given row and column within the splitter. Use SetDlgCtrlId() to set the control ID for the window you want to occupy the splitter pane at row,col. You also need to call SetParent for that same window to set its parent to be the splitter.
Note that the window occupying a splitter pane can be another splitter.
Software Zen: delete this;
|
|
|
|