|
I have used new ATL object to do OLE DB connection,bywhich i got table.h header file,and now i want to insert data in msaccess table by using following code...can anybody help me to solve my problem can you just tell me one thing first whether this way of using to insert data is correct or not...
and what changes should i make it here to correct it
.
//BOOL m_bInserting; // addedd for database
m_TQuote.Open(); // addedd for database
m_bInserting = FALSE; // addedd for datbase
DoModal();
//GetDlgItemText(IDC_EDIT1 ,m_MainEdit);
GetDlgItemText(IDC_EDIT1,m_TQuote.m_DateTimeStamp);
GetDlgItemText(IDC_EDIT1,m_TQuote.m_MarketNo);
GetDlgItemText(IDC_EDIT1,m_TQuote.m_Bid);
GetDlgItemText(IDC_EDIT1,m_TQuote.m_MarketName);
GetDlgItemText(IDC_EDIT1,m_TQuote.m_Ask);
GetDlgItemText(IDC_EDIT1,m_TQuote.m_MarketState);
HRESULT hr = 0;
if (m_bInserting)
{
hr = m_Set.Insert(); // add new row
}
else
{
hr = m_Set.SetData(); //update row
}
m_bInserting = FALSE;
|
|
|
|
|
|
|
|
What is m_TQuote ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
CTquote is class
CTQuote m_TQote
|
|
|
|
|
So what is CTQuote ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Suppose I am receiving an OrderID defined through the following series of declarations:
typedef CHAR Array10[11];
.....
typedef Array10 OrderIDStr;
.....
OrderIDStr OrderID; <--this is the one I am working with
Now, I want a bunch of OrderID, so I make an array like this:
OrderIDStr OrderIDLadder [100];
Then I receive an newOrderID. It is declared as OrderIDStr newOrderID. I try to put it into the array like this:
OrderIDLadder[i] = newOrderID;
And the compiler says "cannot convert from 'char []' to 'char [11]'"
I think it is looking at only 1 character in OrderIDLadder[i], but I'm not sure how to declare my array to make this work. Or maybe I'm not using the subscripts correctly? I have a number of other arrays, but they are float and int, and all work OK.
Bottom line: I want to put each newOrderID into the array. Ideas???
Thanks.
|
|
|
|
|
Use the string functions to copy strings. = doesn't work for strings.
|
|
|
|
|
Thanks.
I used the following:
sprintf(OrderIDLadder[i], "%s\0", orderID);
|
|
|
|
|
i want the animation dialog of Uploading and downloading of files in my FTP client application . To achieve this do i need to have a separate thread compulsory which will show this animation and main thread is downloading / uploading the files.......
Can somebody help me in this.....
Thanks in advance
Saniaa
|
|
|
|
|
The one with the flying documents from folder to folder?
If so, it's an AVI that can be played in an animation control on a dialog.
No secondary thread necessary. Using MFC?
I have the avi if you need it as well.
Mark
|
|
|
|
|
Thanks for your immediate reply ....
i am facing problem that my avi conttrol is on ane dialogbox when i call this dialog box it starts playing the avi with the dialog box popped up so the operation of downloading/uploading of files gets stop.
THanks
saniaa
|
|
|
|
|
A way that you show Avi file
|
|
|
|
|
Sorry i did not get the meaning of your reply ,
can u elabrorate it for me..
Thanks
Saniaa
|
|
|
|
|
On the process you want to show an animation you can show a avi file.
|
|
|
|
|
when i am using this code...error..how to come out with this error
strcpy(m_TQuote.m_ID,SessionId);
error C2664: 'strcpy' : cannot convert parameter 1 from 'long' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
|
|
|
|
|
abrakadbra wrote: strcpy(m_TQuote.m_ID,SessionId);
strcpy expects both parameters to be string and it copies the second parameter into the first parameter.
You will have to convert the first parameter to string before using it with strcpy . Use ltoa or itoa for converting numeric values to string.
|
|
|
|
|
sorry for silly question,i am new to prgraming,how to use this function
|
|
|
|
|
abrakadbra wrote: sorry for silly question,i am new to prgraming,how to use this function
No Problem...
Here[^] is an example on ltoa .
Here[^] is an example on strcpy .
Take a look at sprintf too. Which will be helpful too.
|
|
|
|
|
Hi,
I would like to program a serial port in my VC++ program. All I want to do is whenever I had a mouse click event, I would like to send a positive trigger (sort of a TTL) signal over the com port (so that I can analyse the signal over an oscilloscope for furthur analysis). Is there any simple way of doing this??
thanks,
-Pavan
|
|
|
|
|
1)Open Port
2)Write Port
3)Close Port
on the button event.
have a look
http://www.ontrak.net/mfc.htm
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
Thanks for the link... that library seems great to work with Serial communication. But how can I send data over a single pin on a com port?? Like say, I want to send a 5V signal over pin1 of a serial port on an event in my program, how can I do that?? My program is not an MFC based program, its a pure C++ program written in VC++, to say its actually a DLL I use to interact with from matlab.
-Pavan
|
|
|
|
|
Hi... I managed to use the library provided over here. Thanks for that great library...
-Pavan
|
|
|
|