|
When You select data source and click ok button what happens
|
|
|
|
|
It returns to the Consumer Wizard. Also class, .h file and .cpp file part of the wizard is not editable.
|
|
|
|
|
Did you see window "Select Database Object"?
|
|
|
|
|
No. I right click to the project name and add -> class. Then MFC and MFC ODBC Consumer. Then, when I press add the wizard is seen. I press Data Source button and I select the data source.
|
|
|
|
|
okonur wrote: I press Data Source button and I select the data source.
Is the data source valid? Tested? The datasource needs to be able to connect so it can give
you a list of tables/views to make a class for. If the datasource is valid when you select it
then you should get a login dialog (on SQL server, anyway) if the DB requires it. Then you'll
be presented with a list of tables and views available on the database you've connected to.
It doesn't sound like you are getting this far - check your data source!
Mark
|
|
|
|
|
I pressed "new" to create a new data source. Then I selected MySQL ODBC 3.51 Driver and press "advanced". I wrote:
DRIVER={MySQL ODBC 3.51 Driver}
SERVER=localhost
DATABASE=test
UID=onur
PWD=pass
Finally I saved it under Program Files/ODBC/Data Sources
No any error it gave. However, if I dont write the above parameters, it doesnt set up a connection. What is the problem with those parameters? Could you help me?
|
|
|
|
|
okonur wrote: Could you help me?
I'm trying
Does the database "test" exist? It needs to be created and have at least a table or view in it.
What if, instead of using the Advanced button, you choose the driver, click next - I haven't used
MySQL so I don't know, but other database drivers provide their own dialogs for setting up a
datasource.
I don't know what kind of ODBC interface MySQL has but with SQL Server it gives you a chance to
test the datasource connection as well.
Assuming you've setup your new data source correctly, you'll need to select the new datasource to
proceed with making your ODBC consumer class. I still don't think you're getting this far though.
|
|
|
|
|
The database "test" exists and has tables in it. I think the problem is with the parameters.
|
|
|
|
|
Yes.
Because I have no life, I downloaded and installed MySQL. I've wanted to try it out anyway.
Here's what I did:
Right click on project, choose add class
Select MFC/MFC ODBC Consumer
Click Data Source... button
Click Machine Data Source Tab
Click New Button
Select which type of data source - User or System
Click Next button
Select MySQL ODBC 3.51 driver
Click Next
Click finish
You should see MySQL's ODBC connection setup dialog - Fill in all the info on all tabs
Click the test button - if not succesful fix the info in the dialog
If successful test click ok
You're back at the select datasource dialog - Select the datasource you just created
Now, seeing it in real life - I did a googly search and found this...
MySQL Bugs[^]
hmmm...
|
|
|
|
|
Is your problem solving?
|
|
|
|
|
I am on holiday
|
|
|
|
|
|
See if this article is of any help.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Nice article!
The OPs problem I reproduced is, using MySQL, the 7th dialog in your article never comes up
when using the wizard to create the recordset class.
I wouldn't necessarily expect it to because I was under the impression that getting a list of
tables and views in a database is vendor specific. Am I wrong? Is there a standard SQL
statement to do that?
Thanks,
Mark
|
|
|
|
|
Mark Salsbery wrote: Am I wrong? Is there a standard SQL
statement to do that?
I don't know.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi everyone
I m new to vc++. Now I m doing my undergraduate project in a wifi location system.
I want to track user's position on aGUI containing a map , but I have no idea about images and maps and how to import them and use them in VC++.
I hope someone will show me a webpage or book about this topic.
Thank U in advance.
|
|
|
|
|
What format are your maps, how many are there and how is the users position being represented?
|
|
|
|
|
The maps are JPEG or CAD but i may convert them if necessary.There are more than 4 maps , depending on where the user is the appropriate floor map will be loaded then user's location will be represented by a dot on the map that represents his actual position.
Thank U.
|
|
|
|
|
I don't know about CAD but OleLoadPicture is able to load a JPEG image into an IPicture instance. Search the article on CP to know how to load the picture. Once loaded you will have HBITMAP which is what most of the GDI functions use when drawing to the screen.
Create a window, or choose a RECT in your main window. Use GetDC() CreateCompatibleDC() SelectObject() and BitBlt(), or StretchBlt(), to draw the picture to the screen. Then draw your dot on top of this image using SetPixel() for a single dot, or Ellipse() if you want something a little bigger.
|
|
|
|
|
|
Thanx , i ll try.
Much Appreciated.
|
|
|
|
|
You're welcome
|
|
|
|
|
sameer22 wrote: I want to track user's position on aGUI containing a map , but I have no idea about images and maps and how to import them and use them in VC++.
I hope someone will show me a webpage or book about this topic.
try google api.. search google for same!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
I'm having problems using the following MicroSoft example.
http://support.microsoft.com/kb/178749[^]
When I get to step 6. "Add an include directive for each header file..."
If I try to complile I get 187 errors. Here's the 1st one.
Error 1 error C2371: 'FontPtr' : redefinition; different basic types c:\documents and settings\dan\my documents\visual studio 2005\projects\auotexcel\auotexcel\debug\excel9.tlh 982
I'm running Visual Studio 2005, Microsoft Excel 11.0 Type Library, Windows 2003 Server.
Thanks for any help.
Dan
|
|
|
|
|
Hi! I`m creating a dialog based application with one main dialog containing TabCtrl each of tabs in TabCtrl contain individual dialog. This application will be used for ticket printing in a museum and each tab is for different ticket type, where you will only need to enter the count of visitors. The ticket prices are held in a database. To avoid the need to access database each time the price of a ticket needs to be read, I want to create a global Struct variable, then on applications InitInstance() read the values in to that variable.
Example:
Struct prices<br />
{<br />
double price1;<br />
double price2;<br />
double price3;<br />
double price4;<br />
};<br />
I tried defining the struct in applications header file, then after class definition in same header I added line:
extern CMyApp::prices price;
Later in applications InitInstance() I call:
CMyApp::prices price;
That way I`m able to access price.price1, price.price2.. etc. in any class.
Iv`e heard about creating seperate class for global variables and then access them like CMyGlobals::Variable...
What is the best way of creating global variables? And what is your opinion of my solution.
Thanx!
-- modified at 11:10 Sunday 4th February, 2007
|
|
|
|