|
Hi Mr.Carlos, thanks alot for your answers,
Reply A1:
hmmm, so i must write my database name in Initial Catalog, so what i'll should write in Data Source ?
Can i write only Provider and Data Source in the connection string for connecting to SQL Server database ?
Reply A2:
When my database is Access, then i can use of CursorLocation ?
If my database is SQL Server, then can i use CursorLocation ?
New Q:
What is difference between thease Providers:
SQLOLEDB and MSDASQL ???
New Q:
Question is about CursorType:
When my database is Access, i must use adOpenKeysey instead adOpenDynamic ? why ?
If my database is SQL Server, can i use adOpenDynamic ?
I'm get confuse
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Dear Hadi.
let me see...
A to Re:A1: Is true you can write the connection string without the Initial Catalog, but you need to selecting the default database in the ODBC driver configuration.
A to Re:A2: When you use a access databaase you only can use the adUseClient Cursor Location or adUseNone. Obviously, in this case, that you will use the first option...
A to New Q:
I will copy directly from the MSDN the following:
Microsoft OLE DB Provider for SQL Server (SQLOLEDB), which directly maps OLE DB interfaces and methods over SQL Server data sources. Microsoft OLE DB Provider for ODBC (MSDASQL), which maps OLE DB interfaces and methods to ODBC APIs. OLE DB consumers connect to a SQL Server database through an existing SQL Server ODBC driver.
We recommend using SQLOLEDB, supplied with SQL Server, as your OLE DB provider. SQLOLEDB maps OLE DB interfaces and methods over SQL Server data sources without using the ODBC API or the SQL Server ODBC driver as intermediaries.
There are differences between SQLOLEDB and MSDASQL. The two providers support different connection properties, and SQLOLEDB does not support the use of an ODBC DSN connection.
A to new Q2:
The problem is the following. When you use CursorLocation equal to adUseClient the only cursor type for use is adOpenStatic if yiu use another cursor type ado will use open static cursor. When you set adUseServer in your cursor location you can select every cursor type.
Cheers!!!;)
Chau!!!
Carlos Antollini.
|
|
|
|
|
Hi again Mr.Carlos ...
Thanks again for your answer ... your help was useful ...
I got my all answers, only i have theory question about CursorLocation, still:
If i wanna write my program for the Server computer, i must change CursorLocation to adUseServer ?
and
If i wanna write my program for the Client computer, i must change CursorLocation to adUseClient ?
Is it right ?
Is it for all databases ?
With Warm Regards,
Hadi !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You don't want to answet to me ?
(Please check my last question ...)
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I'm sorry Hadi, I have no pardon....
First. Is true you need to use the cursor location over the server.
The explanation is the following. When you select Client Side, the bookmarks, moves, etc are used in the side of the client, dependes the resources that you have in your pc.
When you select server side, the cursor is used the side of the server. The problem is that some databases have no cursor in the server side like Access, because access is not a server. Is like a PassThrought.
If you are writting a program for SQL Server the best is to use the cursor location in the server side, because in that mode you are using the cursor provided for the server, and the server resources for that operation.
Is Clever Now?;)
Bets Regards.
If you don't understood, notify me, because my English is not as well that I want...
Carlos Antollini.
Today is friday!!! for All!!!
|
|
|
|
|
In resume, you need to know what is better for you database, for example if you are using a Jet Database like Access, dbf, etc the only option is adUseClient.
If you are using Database Server like SQL Server, My Sql, Oracle, SyBase, etc the best is adUseServer, but you have the option of adUseClient, but the best for this case is adUseServer...
Best Regards again.
Carlos Antollini.
Today is Friday!!! for All!!!
|
|
|
|
|
Hi Master.Carlos ...
Now, i understand ...
By the way, your English language is very better than me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Whit the resource editor I've created a DialogBar whit button, combo box, check box...
When I wan't to enable/disable them I use the member variable I've create just for them and call theControlVariable.EnableWindow(TRUE);
and it's work very fine... except for push button who become enable and immediatly after disabled...
why?
thanks
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
CDialogBar uses command UI update mechanism for buttons. You should add ON_COMMAND handler in the frame class - this will solve the problem of disabled button and provide a place for code which will be executed when user pushes the button. If you want to conditionally enable/disable the button, add ON_UPDATE_COMMAND_UI as well.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Does anyone know how to get the address that internet explorer is browsing? And how to do this for multiple instances of IE? This is for a little program to monitor Web contents that is viewed on a LAN (to keep an eye on naughty students )
Thanks
Kuniva
|
|
|
|
|
Use the BeforeNavigate2 event from IE and write a Browser Helper Object DLL, this will work with every instance of IE.
Use google.com to search for "BeforeNavigate2" and "BHO", you'll find enough resources
regards
|
|
|
|
|
http://codeguru.earthweb.com/ieprogram/enumIE.html
there you go... 90% of your work is done!
|
|
|
|
|
wow! thanks, this is all i need!
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|
|
Hi
I want to count the number of lines in a textfile.
I know how to open and read from a file, but how can I read exactly line after line?
regards
|
|
|
|
|
Are you using FILE*, MFC's CFile, standard C++ iostreams, or pure Win32 CreateFile?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm familar with FILE* and CFile.
If possible, I'd like to use pure Win32 without MFC
|
|
|
|
|
If possible, I'd like to use pure Win32 without MFC
You'll have to look for line breaks yourself - Win32 API doesn't differentiate between 'binary' and 'text' files. Call ReadFile in the loop until EOF and search for \n in the input buffer.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Ok thanks I will try
Is there an easier way with MFC?
|
|
|
|
|
Is there an easier way with MFC?
Yes, there is. Use CStdioFile, pass CFile::typeText when opening the file, and call CStdioFile::ReadString until you reach EOF. Each ReadString reads one line of text.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Works fine
Tomorrow I'll try the Non-MFC way
|
|
|
|
|
I use the following in a number of apps
if ( !(m_pLogFile = fopen(lpFileName, "a+")) )
which will create a file if it doesn't exist, or if it does, append to the end of the file. Very handy for log files and such. In another app, I'm using a CFile object
CFileException exFileError;
if ( !m_fileExtract.Open( m_strQualifiedPathAndFilename, CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite|CFile::shareExclusive, &exFileError ) )
and the no matter what various combinations of options I specify, I can not get it to append to an existing file. Is this something that is missing from the CFile class, and if it is, I welcome suggestions for how to do appending to an existing file.
Thanks.
Chris
|
|
|
|
|
Maybe you should move the file pointer to the end of file? modeNoTruncate combined with modeCreate should open the file if it already exist without erasing its contents. Try calling SeekToEnd after Open.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz, you are always on the ball!
I'm just looking into various positioning methods of the CFile class and expect that is what I'll try. I was expecting CFile to have an 'append' option for the Open method and since there isn't, I'll have to do it myself.
Thanks for the help, again
Chris
|
|
|
|
|
i am having a problem with tool tips displaying slowly.
At first i thought they were not working. but i found i left my mouse over the control for about a second the tip came up. After that all the tooltips for the objects beside them, as long as i did not lose focus of any, came up fast.
I have an onnotify message
ON_NOTIFY_EX(TTN_NEEDTEXT,0,OnToolTipNotify)
and it does not init for about 1 sec after i move to the control. Also if i keep moving the mouse over the control it will not init. I have to stop
I hope this makes sense.
thank you:
confused:
|
|
|
|
|
TTN_NEEDTEXT is sent just before tooltips shows itself. Did you try to change the activation time with CToolTipCtrl::SetDelayTime?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|