|
Sridhar Sanikommu wrote:
Did you have any example of Bulk Insert functionality?
Possibly. Assuming the table looks like:
Name Type
---- ----
col1 char(3)
col2 int Create a file named mydata.txt that looks like:
abc,1;def,2;ghi,3; Load this file into the table with:
BULK INSERT <table name here>
FROM 'mydata.txt'
WITH
(DATAFILETYPE = 'char',
FIELDTERMINATOR = ',', ROWTERMINATOR = ';') Sridhar Sanikommu wrote:
Does it work with all the databases?
Having not used "all the databases," I couldn't possibly know.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi David,
I appreciate your quick response. This is the first time I posted my question in code project though I opened my account long time back(almost two years) and been following message board Q&A's. Especially, if I encounter responses from yourself, Micheal Dunn, Ravi, Prakash(you people are top of my head) etc I go through the techniques that you guys suggest.
Keep going....pass your knowledge and empower others.
BTW, do you have any generic database module(using CDatabase & CRecordset classes) which I can get?
Thanks,
Sridhar
|
|
|
|
|
I have a question regarding copying of whole compressed (DIVX) streams with the AVIFile API.
This code snippet copies the video stream to another file, but that file gets about 10 times bigger than the original. I guess the target stream is uncompressed, but the streaminfo explicitely states DIVX.
How can I copy streams from one file to the other without decompressing/compressing (direct stream copy)?
<br />
HRESULT hr=S_OK;<br />
<br />
PAVIFILE pSourceFile=NULL;<br />
PAVIFILE pTargetFile=NULL;<br />
<br />
PAVISTREAM pSourceStream=NULL;<br />
PAVISTREAM pTargetStream=NULL;<br />
<br />
AVISTREAMINFO streaminfo;<br />
BITMAPINFOHEADER bitmapinfo;<br />
<br />
AVIFileInit();<br />
<br />
hr=AVIFileOpen(&pSourceFile,"test_source.avi",OF_SHARE_DENY_WRITE,0L);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIFileGetStream(pSourceFile,&pSourceStream,streamtypeVIDEO,0);<br />
if(FAILED(hr))<br />
...<br />
<br />
LONG bitmapinfosize=sizeof(bitmapinfo);<br />
hr=AVIStreamReadFormat(pSourceStream,0,&bitmapinfo,&bitmapinfosize);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIStreamInfo(pSourceStream,&streaminfo,sizeof(streaminfo));<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIFileOpen(&pTargetFile,"test_target.avi",OF_CREATE|OF_WRITE,0L);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIFileCreateStream(pTargetFile,&pTargetStream,&streaminfo);<br />
if(FAILED(hr))<br />
...<br />
<br />
hr=AVIStreamSetFormat(pTargetStream,0,&bitmapinfo,sizeof(bitmapinfo));<br />
if(FAILED(hr))<br />
...<br />
<br />
LONG lbuffersize=20000;<br />
BYTE* buffer;<br />
buffer=new BYTE[lbuffersize];<br />
<br />
LONG lPos=0;<br />
LONG lLen=0;<br />
for(long lPos=AVIStreamStart(pSourceStream);lPos<AVIStreamEnd(pSourceStream);lPos++)<br />
{<br />
hr=AVIStreamRead(pSourceStream,lPos,1,buffer,lbuffersize,&lLen,NULL);<br />
if(FAILED(hr))<br />
...<br />
<br />
DWORD dwFlag=0;<br />
if(AVIStreamIsKeyFrame(pSourceStream,lPos))<br />
dwFlag=AVIIF_KEYFRAME;<br />
<br />
hr=AVIStreamWrite(pTargetStream,lPos,1,buffer,lbuffersize,dwFlag,NULL,NULL);<br />
if(FAILED(hr))<br />
...<br />
}<br />
<br />
if(pTargetStream)<br />
AVIStreamRelease(pTargetStream);<br />
<br />
if(pTargetFile)<br />
AVIFileRelease(pTargetFile);<br />
<br />
if(pSourceStream)<br />
AVIStreamRelease(pSourceStream);<br />
<br />
if(pSourceFile)<br />
AVIFileRelease(pSourceFile);<br />
<br />
delete[] buffer;<br />
<br />
AVIFileExit();
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
I'm using TerminateProcess to shut down explorer.exe (not iexplore.exe). This works, but a few seconds after explorer.exe is terminated, it starts back up. When I terminate explorer though the Windows Task Manager it doesn't restart itself.
I want to control when exporer.exe starts back up. How do I keep it from restarting itself?
(I can post my code if anyone thinks it's necessary.)
Thanks for the help!
Ian
|
|
|
|
|
haven't you ever noticed that when windows freezes and you have no desktop and no taskbar anymore, you can do "New task" (with Crtl+Alt+Del or Ctrl+Shift+Esc for example) and type in the field explorer...
i don't think the way you think is able to controle what you want.
TOXCCT >>> GEII power
|
|
|
|
|
I'm not sure I follow you. I want to shut down explorer.exe. This I have done (I can see it dissapear from the process list in Windows Task Manager).
Now I need to figure out how to keep it from starting itself back up. I know this is possible because I have seen other applications that shut it down and keep it down. I don't suppose they continually shut it down in a separate thread?
|
|
|
|
|
|
|
oooppss, didn't see that you had the answer
|
|
|
|
|
Hi,
i created a toolbar using CreateWindowEx() but i got no XP toolbar (im using xp).
how can i make it so?
|
|
|
|
|
I am not looking to create, rather I am more looking for advice on something to buy.
I would like to be able to scan in paper forms and use a tool to convert the image into a form that C++ can use.
If such a tool does not exist, can you point me towards a tool that would build HTML or other interface from a paper form.
thanks
|
|
|
|
|
I found that a word doc file can be saved as HTML.
But how can I save a HTML as a word DOC?
Any ideas? Thank you very much!
Alick
|
|
|
|
|
|
I have a question during providing services to some users.This product should get this result:First,push the button on the dialogue; then the excel form should appear;and last,when I choose any row, the data of this row can be read by the program.Anyone know how to achieve this function? Thanks!
|
|
|
|
|
From my experience I can tell you I've found two ways to read data from excel files, one is by adding the excel assembly reference to your project and creating an instance of the Excel application object, I suppose this would be the only way to actually 'show' the Excel grid programmatically, beware though, that this requires excel to be installed in any client executing you app. The other way is to use Extended Properties of the OleDbDataAdapter which allows you to get a range of cells or an entire worksheet into a DataTable, thereafter you can manipulate the data, show it in a datagrid or do whatever you need with it.
Chris.
|
|
|
|
|
Here an msdn search that will give you some articles/samples on doing this with ado.net's dataadapter:
http://search.microsoft.com/search/results.aspx?qu=excel+file+ado.net&View=msdn&st=b&c=0&s=1&swc=0
|
|
|
|
|
Hi,
im coding proper SDK now and i did a toolbar with couple of buttons, and each button got a BMP file that i created.
how can i add 24bit bmp and not only 8bit?
Avi
|
|
|
|
|
|
yeah, but everything is fine except that im coding only with SDK and no MFC.
do u know the exact way to do it bcuz i searched everywhere and nothing
|
|
|
|
|
I would have downloaded the sample for one of the toolbars, for example http://www.codeproject.com/docking/ctruecolortoolbar_update.asp[^]. Build the sample and singlestep - in this case it's the function LoadTrueColorToolBar that is interesting. Step into the MFC source, where you will see the underlying SDK calls. The main problem with MFC is not that it is complicated, rather that it is a far too thin wrapper of the SDK
|
|
|
|
|
Hi,
how can i get the document pointer of CDocument derived class and traverse thru all views of the document?Say i have the caption of the MDI child Frame which should be activated..Currently that frame is inactive and some other frame is active.Now how can i activate that view....Is there any way such that i can get the handle of the child frame and then gets its window text and compare with my own text.If they both match then bring that frame and its view to active state..........how can i do it????
|
|
|
|
|
Poorniselva wrote:
how can i get the document pointer of CDocument derived class...
From the view class, call the GetDocument() method.
Poorniselva wrote:
Now how can i activate that view...
How about CFrameWnd::SetActiveView() ?
Poorniselva wrote:
...and then gets its window text
Use GetWindowText() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
plz
some one tell me how can i display bitmaps file in my app?
|
|
|
|
|
See if any of these articles help.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
I am currently writing a Windows Background Service and have run into some trouble.
So far things have been going well, but the only problem I have is that I need to set the state of the CAPS LOCK to on, which I am unable to achieve.
I have include winable.h and I am using the code:
::keybd_event( VK_CAPITAL, 0x45, KEYEVENTF_EXTENDEDKEY, 0 );
::keybd_event( VK_CAPITAL, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0 );
Which works in a regular console application, but I can't seem to get it to work in a windows service.
Is there some sort of security restriction that prevents me from changing the key state? Other then that, I have no idea.
Thanks in advance
|
|
|
|