Trying to connect a remote MySQL Database to Visual Studio 2010 Pro (C++) - c++

Ok guys, I've been trying to get this working for a few weeks in my spare time, and all day today, and I have nothing to show for it, so here's my question.
First off, the end goal for this is to read and write basic information (id #s, names, etc.) from a remote mysql database, to a C++ program written in Visual Studio 2010 Pro, or something equivalent (and free). I access the server from my laptop with SSH, and I can call family members to mess with router settings and such.
I'm trying to use a MySQL database on a Ubuntu Server machine that I access remotely from a Windows 7 laptop. I have installed MySQL Connector C++ from the MySQL website (the msi installer). NOTE: I have not done anything with the Connector install except run the exe I downloaded. Didn't think I needed to compile anything, but I'm wrong a lot. I have created a database, a user who has privileges to the database, and this user can (in theory) connect from any ip, because it is declared as 'username#'%'. I also changed the my.cnf file so that the bind-address line is commented out. I used 'mysqladmin ping -h serveraddress -u username -p' and that gave me 'mysqld is alive', so I'm assuming the database is accessible from any ip remotely. So, I opened up VS 2010 Pro, made a new project, went to tools, and then 'Connect To Database'. I selected Microsoft MySQL Server and put in the information exactly as I did for mysqladmin. I clicked Test Connection and I get an error box that ends with 'provider: Named Pipes Provider, error 40 - Could not open a connection to SQL Server'. Sorry for the block of text, just want to give all the details I can.
Hopefully I'm close to making this work, I'm not pressed for time but I'm really tired of not being able to work on anything else in the project, since it all branches from this database connection.
Thanks you all! I'll reply with whatever you need me to during the day, I'm not much of a night owl anymore =)
UPDATE:
I have the sample code from the mysql site compiling correctly, it was just a matter of finally getting a few hours to sit down and fix linker/library errors one at a time, downloaded the boost libraries, and changed include directories to direct paths when I could get them to work correctly. Now all I need to do is learn how to use it lol
Thanks all!

Not sure if this is the problem but be sure to use the 32 bit ODBC Administrator if you are building a 32 bit application. If you are on a 64 bit PC, by default you are going to be using the 64 bit ODBC Administrator and consequently your 32 bit application won't actually see the DSN that you've created. Run the 32 bit ODBC Administrator using this path: C:\Windows\SysWOW64\odbcad32.exe and then create your DSN.

Related

Visual Studio 2017 installer extremely slow

I tried to install the latest VS 2017 Update yesterday and since then I cannot get it to finish this.
This worked pretty fine in the last months and stopped working yesterday.
I already tried to do the following:
Uninstall VS 2017
Remove folder %PROGRAMFILESx86%\Microsoft Visual Studio\2017
Remove folder %PROGRAMDATA%\Microsoft\Visual Studio
Restart machine
I have a 50 MBit/s download rate and all other apps are working just fine. If I look into the logs I can see failed downloads when I abort the instalation. When I pick one of the URLs there and just download the vsix directly via the browser it just works.
Is there any caching or network setting that might be useful in this case?
UPDATE
I have tried 2 downloads (WLAN) from MS servers right now:
Has MS issues on certain download servers maybe and what to do or whom to tell in those cases?
I had the same problem with VS2017 Preview. I disabled IPV6 in the network adapter properties. After that the installer ran with full download speed.
After some heavy investigation and because of the feedback of trinitrotoluol I solved the issue by using an external VPN endpoint. That means, that my German hoster (Telekom) has got problems with some Microsoft download-servers. We contacted them but (not very suprisingly) there is no way to encourage them to examine their network a little bit deeper. So turns out that we have to wait until they fix this back or use a VPN client for such cases.
change download location via hosts (C:\Windows\System32\drivers\etc) entries:
I checked alternative servers with ping-test.ru
For example:
93.184.215.201 download.visualstudio.microsoft.com
or
68.232.34.200 download.visualstudio.microsoft.com
or
192.229.232.200 download.visualstudio.microsoft.com
or
27.22.54.160 download.visualstudio.microsoft.com

Connection of c++ with mysql in Linux

I am learning to work with mysql and c++ in ubuntu os. There are several tutorials on how to interface mysql with c++ in visual studio or in windows, but not one for Linux. Mysql website also does not describe properly on this.
Can anyone suggest me a link to tutorial, book or any thing that gives information an how to interface c++ with mysql in Linux. My database is in linux machine itself.
Thanks for the great help.
Mysql is a database, and to gain access to the data within C++ you will need to be able to “talk” to the database via queries (just like on the mysql command line interface e.g. select * from tablename), the connection process is very similar to the command line interface you will need to supply connection details as in hostname (localhost normally), username, password, database to use and also there are other details that you can pass e.g port number more information can be gained from the MYSQL API pages.
This link has a good example
Connect mysql in c++ for unix

PC File server variable performance when importing from Access MDB

I've got some code that runs in Enterprise guide (SAS Enterprise build, Windows locally, Unix server), which imports a large table via a local install of PC File server. It runs fine for me, but is slow to the point of uselessness for the system tester.
When I use his SAS identity on my windows PC, the code works; but when I use my SAS identity on his machine it doesn't, so it appears to be a problem with the local machine. We have the same version of EG (same hot fixes installed) connecting to the same server (with the same roles) running the same code in the same project, connecting to the same Access database.
Even a suggestion of what to test next would be greatly appreciated!
libname ACCESS_DB pcfiles path="&db_path"
server=&_CLIENTMACHINE
port=9621;
data permanent.&output_table (keep=[lots of vars]);
format [lots of vars];
length [lots of vars];
set ACCESS_DB.&source_table (rename=([some awkward vars]));
if [var]=[value];
[build some new vars, nothing scary];
;
run;
Addenda The PC files server is running on the same machine where the EG project is being run in both case - we both have the same version installed. &db_path is the location of the Access database - on a network file store both users can access (in fact other, smaller tables can be retrieved by both users in a sensible amount of time). This server is administered by IT and not a server we as the business can get software installed on.
The resolution of your problem will require more details and best solved by dialog with SAS Tech Support. The "online ticket" form is here or you can call them by phone.
For example, is the PCFILES server running locally on both your machine and your tester's machine? If yes, is the file referenced by &db_path on a network file server and does your tester have similar access (meaning both of you can reach it the same way)? Have you considered installing the PCFILE server on your file server rather than on your local PC? Too many questions, I think, for a forum like this. But I could be wrong (its happened before); perhaps others will have a great answer.

Fail to CoCreateInstance an EXE COM server

I have an EXE COM server (used to elevate our application to a higher integrity level) which is downloaded to %temp% and registered by an ActiveX control. This COM server works pretty well on Vista machines. On Window 7 machines I got something wired: the COM server can be downloaded and registered successfully, but I got the error 0x80080005 (Server execution failed ) when trying to initialize the server by CoCreateInstance. If I copy the COM server to %temp% manually instead of downloading it via internet then everything works as expected. I am suspecting that the downloaded EXE files have some special attributes that prevent it been loaded but have no idea how to figure it out.
Does anyone have the same experience or have any clue for this issue? Any suggests will be highly appreciated.
Joe
Yes they do. Start a command prompt and use DIR /R. You'll see the alternate data stream in the file. The one that says: "don't trust this file, it came from an untrusted source".
You can delete them with the filename:streamname syntax. Check if that's okay with your customer first. I don't know many that are thrilled about EXEs getting downloaded and bypassing normal security rulez.

Several machines running same software, some won't connect to firebird

I'm pretty perplexed... I've got 5 different test computers, all relatively blank Windows XP machines running similar hardware specs. I run a silent install of the FireBird (Classic) database and my application. Some computers require "localhost:" (or 127.0.0.1) before the database location to make a connection, and some simply don't work at all! This is running the exact same software across the board. Does anybody have any suggestions as to what needs to happen to make the connection string universal, or what I could be doing wrong??
It's firebird version 2.1.1.17910 Classic
By the way, i tried connecting to the same database using FlameRobin (a small db management tool) and it worked just fine on the computers that don't connect.
Any more information necessary just let me know! Thanks a lot in advance
For anybody's future reference, the answer is in the services. Apparently it's not being registered as a service for some reason, and on the working computers, was at some point registered, probably through some sort of far earlier tests of Interbase is my best guess.
C:\Windows\System32\drivers\etc and opening up the file 'services' and adding the following line allows the server to run properly.
gds_db 3050/tcp
I'm not sure whether you are aware of that, but a connection string without "localhost:" or "127.0.0.1:" in front of the database name or alias will use the local protocol, which can't be used when connecting to Firebird Classic Server (see this link for more information). If a host name or IP address is given, then TCP port 3050 will be used for the connection.
If you have registered a server in FlameRobin, and did not leave the hostname field in the registration dialog blank, then the host name will be part of the connection string. That would explain why you can connect using FlameRobin.
As for the differences between the machines: You should first go to the Firebird Server Manager applet and make sure that the server is indeed running on all machines, and that the version is the same.
Does it have something to do with the hosts file on some of the computers? Or is that what you're referring to with your
Some computers require "localhost:" (or 127.0.0.1) before the database location...
comment?