List:MySQL++« Previous MessageNext Message »
From:David Parker Date:November 1 2005 4:53am
Subject:mysql++ and ADO namespace conflict
View as plain text  
Platform:  WinXP Pro w/VS 2003/VC++ 7.1 - All service packs installed.

 

I have a COM object I am building which accesses both a Jet (Access)
database and a MySQL database.  I had been using ADO for both but kept
running in to errors accessing MySQL that gave me no information about
what actually went wrong.  I felt the lack of info in the errors was
likely due to the fact that my calls were going through many layers: ADO
to OLEDB to ODBC to MySQL.  I figured direct access to MySQL would be
better all around, so I downloaded mysql++ and got it to build just
fine.  I read the tutorials, looked at the samples, and then went to
convert my code.  

 

The first problem I ran into was that both ADO and mysql++ define Field,
Fields and Connection classes.  I did not think this would be an issue,
because I could just not use the "using mysqlpp" directive and reference
all of the mysql++ names explicitly, but I was also trying to use the
nifty SSQLS functionality, and it turns out that the sql_create_x macros
will not compile unless "using mysqlpp;" has been declared.  Note that I
tested my theory by removing the using directive from custom1.cpp and
making namespace references explicit and I got the exact same compile
errors as my COM object did.  Some of the solutions I thought about
were:

 

1) Try to fix the sql_create_x macros (not likely since I am not very
proficient in Perl)

2) Try to isolate all of my references to ADO and mysql++ from each
other (this would be quite a bit of work)

3) Rename the Field, Fields and Connection classes (tried this, but
started getting nasty linker errors in my COM object - the lib built
fine, though - and those can be very tricky to track down)

4) Abandon using SSQLS and go with straight mysqlpp and reference all
symbols explicitly.

5) Abandon mysql++ altogether.

 

Having pretty much either ruled out or tried 1-3, and feeling that #5 is
a last resort because clearly many people use this library, so I am
certain I can get it to work, I am currently attempting #4.

 

However, I thought I would still report the issue here in the hopes that
someone has a simple solution to my problem.  Short of that, I would at
least like to report it as a potential bug so that it could be addressed
in a future release (again, if was better at Perl, I would fix it and
then report the problem along with my potential fix).  

 

Any comments/suggestions/etc. will be greatly appreciated.

 

Thanks,

Dave Parker

IT SystemWorks

 


Thread
mysql++ and ADO namespace conflictDavid Parker1 Nov
  • Re: mysql++ and ADO namespace conflictChris Frey1 Nov
    • Re: mysql++ and ADO namespace conflictWarren Young1 Nov
      • Re: mysql++ and ADO namespace conflictChris Frey2 Nov
RE: mysql++ and ADO namespace conflictDavid Parker1 Nov