|
Yes. You do this with the connection string.
Below is the example of this I took from the link I gave you:
CADODatabase* pAdoDb = new CADODatabase();
CString strConnection = _T("");
strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\VCProjects\\ADO\\Test\\dbTest.mdb");
pAdoDb->SetConnectionString(strConnection);
John
|
|
|
|
|
Thank you. That's very helpful.
I'm using Microsoft Visual Studio 2003.NET. Does ADO come with this IDE, or is ADO something I need to install separately. I found a beginning ADO tutorial in the articles, and attempted to start it, by inserting the following code into a console project:
#import "msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
The tutorial I'm using is here: http://www.codeproject.com/database/simpleado.asp
And attempted to compile, with the following error:
c:\XXX\My Documents\Visual Studio Projects\MS Database\stdafx.h(14) : fatal error C1083: Cannot open type library file: 'msado15.dll': No such file or directory
I'm assuming this means that ADO is either not installed, or configured correctly. I do not know how to check if it is installed. I went to the MS Site on ADO:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdconreferencingadolibrariesinvc.asp
And it gave me the same instructions, did not say anything about installing ADO, so I assume it should be installed?
Sorry, like I said this is my first time trying to work with a database, and I've never touched ADO before.
Thanks for bearing with me.
|
|
|
|
|
budidharma wrote:
c:\XXX\My Documents\Visual Studio Projects\MS Database\stdafx.h(14) : fatal error C1083: Cannot open type library file: 'msado15.dll': No such file or directory
Try this:
#import "C:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
budidharma wrote:
Does ADO come with this IDE,
No ADO/MSDE does not have an IDE. I use ACCESS and AdoQuery tool (link below) to work with my MSDE databases.
http://gpoulose.home.att.net/[^]
John
|
|
|
|
|
Ah. Apparently it wasn't configured correctly. He assumed I had a system variable set to point to the correct direction of ado.
It works now, thank you very much.
Does ADO come with this IDE - I didn't mean, does this IDE have an ADO based query tool, I was referring to the msado15.dll lib.
Apparently it did come.
I'll check out that ADOQuery tool as well. Thank you very much for getting me started.
|
|
|
|
|
I am developing a GUI application using winforms in vc++ .net.
I have an event (onButtonClick) which reads a matrix from file input from user.
I want to access this matrix for couple of other event including displayGraph_Click. Can anyone send me info on how I should declare this float data matrix
Sunit
|
|
|
|
|
If I do
int fd= open(myfile, O_RDONLY);
and its successful, then close it immediately, it crashes on linux
close(fd);
This doesnt happen on windows. ???
Thanks
sb
|
|
|
|
|
Hi
I need random number generator.
In my case, RN generator must to generate random number every second.
How can i decide it?
If you have any suggestion, help me pls
Help me
|
|
|
|
|
Hi,
If you are using a windows app, you can use a WM_TIMER callback. Other than that you can create a thread that sleeps for a second generates a random number, etc.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
My problem is:
when i define like this
typedef float Sequence[];
i dont know how to declare an array with Sequence.
Ex:if i declare
Sequence a[10];
it doesn't work.
Can you help me???
Thank in anticipation!!!
|
|
|
|
|
I doubt that you can. Why would you do this ? Why obsfucate your code with not just typedefs, but a typedef that hides the fact that you're dealing with an array ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
Typedefs are like fancy text replacements, so you just coded:
float a[10][]
Hence the compiler does not know what the second index is. You are creating a double pointer list.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
use:
typedef float Sequence;
Sequence a[10];
Bye and c ya!
|
|
|
|
|
No MFC. The word makes my head ache more than ever. I looked all over the place for someone who knows the answer... So far I have reached this much... I have a status bar in a MDI application that blinks like crazy when I have 1+ child on the screen. When I move the child over the status bar it tears.... I heard that you need a back buffer? But how to you make a backbuffer out of a HWND. What does a HDC have to do with a HWND. Please someone help me with a sample...
Heres a my code
<br />
<br />
Kbar = CreateWindowEx(0, STATUSCLASSNAME, NULL,<br />
WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,<br />
KhWnd, (HMENU)IDC_MAIN_STATUS, GetModuleHandle(NULL), NULL);<br />
<br />
in WM_SIZE I have this.<br />
<br />
void OnMainSize(LPARAM lParam)<br />
{<br />
SendMessage(Kbar, WM_SIZE, 0, 0);<br />
}<br />
Please help me...
|
|
|
|
|
What does the Kbar WM_SIZE code do? When I have a child window linked to a parent window's size, I just size the child with a SetWindowPos in real time with the parent.
|
|
|
|
|
hai..
i encountered a problem on the traffic light simulation project..
how can i change the colour of traffic light and using what item..
also how can i make the car moving in the required time..
so they dont crash on each other..i used 4 junction.
can anyone help me please..
im running out of time..
|
|
|
|
|
You can't possibly be using MFC AND VB.NET, at least I can't imagine why you would, given that VB.NET is good for nothing more than making a UI, and MFC is a UI library in C++. Either way, you need to do your own homework, and ask questions after you've tried to do it yourself, and have some specific problem you need help with.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
Let me get this right, you need to control 4 traffic lights and cars with the roads connected in a square??
The simple thing to do is just create a traffic light and car classes and create methods that would allow you to move the cars and change the lights of the traffic signals. Then in your main algo set the traffic lights and create a list of cars that are waiting on each light.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
hello...
i encountered a problem on my project..
my project is a game. kinda like a jumble word..
is like arrange from a various word to make a sentence..
so how to detect if the answer is right
and also how to drag the to words to make the sentence.
please..
can anyone outhere help me.
im running out of time..please i need anyone to help me
please....please
|
|
|
|
|
Hi,
Your specification does not make a lot of sense. From what I can get out of this is that you are to select words, move them around to make a sentance and decide if the sentance is correct?? Please clarify.
If the above is correct, then you would need some sort of gramma engine, unless you know all the sentances that can be made with the words.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
hello...
i encountered a problem on my project..
my project is a game. kinda like a jumble word..
is like arrange from a various word to make a sentence..
so how to detect if the answer is right
and also how to drag the to words to make the sentence.
please..
can anyone outhere help me.
|
|
|
|
|
Welcome to Code Project. The Visual C++ forum is the place to ask MFC questions, this forum is for managed C++, although I guess it must be MC++ if for some bizarre reason half your code is in VB.NET.
There's no forum here for you to ask people to do your homework for you, you should go to rentacoder if you want to try and pass your subjects without doing any work. Not that this will help you get a job at all.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello!
I wonder if there is some way or some trick to gather some info during compile time and using it at runtime ?
example1:
We have many cpp files. We have some #define CPP_COUNTER 0. There would be some code (macro?) at the begining of every cpp file which would increase this counter for 1. When linking the project, CPP_COUNTER would hold the number of cpp files. In runtime I would be aware of cpp files in the project by reading CPP_COUNTER definition.
example2:
We have many files in the project, but functionaly they are divided in few modules (dsp, writter, reader, etc). At compile time every cpp file would have at the begining some code which would register (to some global variable) to which module it belongs. Something like
REGISTER_MODULE(_FILENAME_, "disk writter")
In runtime I would be aware of all the modules in the system by looking at the global variable of all registered modules.
I would need something like example2 shows. Is it even possible? Is there some way?
Best regards,
Rostfrei
|
|
|
|
|
Hi Rostfrei,
One way of doing this is to create a dummy counting class and just create instances of it. Hence this becomes:
countcpp.h:
#ifndef __COUNT_H__
#define __COUNT_H__
#include <iostream.h>
#define REGISTER_MODULE(file,des) static CCountCpp g_cppFile (file, des);
class CCountCpp
{
public:
CCountCpp (void) { }
CCountCpp (const char *strFile, const char *strDes)
{
cout << strFile << "{ " << strDes << " }" << endl;
++m_iCppCount;
}
static int m_iCppCount;
};
#endif // __COUNT_H__
This just creates a static CCountCpp object per REGISTER_MODULE define. Because of the static objects they can be the same name across modules as long as you are not including .cpp files. To use:
#include "countcpp.h"
REGISTER_MODULE(__FILE__, "disk writer");
int CCountCpp::m_iCppCount = 0;
void main (void)
{
CCountCpp c;
cout << "Cpp count: " << c.m_iCppCount << endl;
}
Naturally you would remove the main, it is just there for show.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
Problem part1:
ActiveSync sequencing between a desktop PC and a remote WindowsCE project that has been written using eMbedded C++ 4.2.
At the desktop PC...
STEP 1:
run
"C:\Program Files\Microsoft ActiveSync\WCESMgr.exe"
Select from the "File" menu,
"Get Connected..."
Click the "Next" button on the "Get Connected" window
STEP 2:
At the remote WindowsCE project...
cause the application to call
CreateProcess(_T("Windows/repllog.exe"), NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, &m_procInfo);
This gets me a connection. However, if I cause the application to call CreateProcess anytime before clicking on the "Next" button (ie. STEP 2 first, then STEP 1), I don't get a connection.
Can anyone tell me why this might be? Is it possible that there is some functionality missing in the remote's operating system?
Problem part2:
Also, I have tried the CODE PROJECT "Command-line utility for PocketPC (RCMD.exe)" project and this works perfectly well between the desktop PC and a PocketPC. When I try it with my remote WindowsCE project though, it doesn't get a connection at all.
Once again, does anyone have any ideas please (most likely the same problem)?
Problem part3:
This is the first time I've tried to do anything like this so I'm afraid I'm rather green!!!
Thanks to everyone and anyone who can help.
Mark
-- modified at 10:26 Tuesday 20th September, 2005
|
|
|
|
|
hi,
i want to do a latedelte on windows 9x. a directory should be deleted. but it does not work. i use the wininit.ini to delete the direcotry.
do i use the wrong code or is this impossible?
best regards
emmi
|
|
|
|