Discussion:
ADOLISP & MYSQL working, but weird
(too old to reply)
Robert Broussard
2003-12-30 13:59:26 UTC
Permalink
I can write to database tables and run querries using ADOLISP and MYSQL 4.0.15 (big thanks to Jon Flemming), but when I try to view the tables with dbconnect I get a weird error:

An error occurred in executing the SQL statement.
<SQL Error Information>
cursor operation conflict
Code 2304 SQLSTATE 09000

Has anyone seen this error before? I searched google on this error and found other people asking the exact same question I'm asking here, but I never found any solutions.

If Jon is reading this,

is it possible to use ADOLISP with Oracle Standard? And how important is it to use dbConnect with regards to keeping AutoCAD and database synched if all of my data is stored in database and NONE in attributes?

Thanks to anyone for their time.

Robert
R. Robert Bell
2003-12-30 16:50:59 UTC
Permalink
I've never run MySQL, so I'm no help there. However, on the dbConnect
question... you should use CAO (the underpinning of dbConnect) to make the
links to the database, because it handles such things as copying a linked
item (you get two objects linked to one row) that you otherwise would need
to write a slew of reactors/event handlers to perform.
--
R. Robert Bell, MCSE
www.AcadX.com


"Robert Broussard" <***@autodesk.com> wrote in message news:***@jiveforum1.autodesk.com...
| I can write to database tables and run querries using ADOLISP and MYSQL
4.0.15 (big thanks to Jon Flemming), but when I try to view the tables with
dbconnect I get a weird error:
|
| An error occurred in executing the SQL statement.
| <SQL Error Information>
| cursor operation conflict
| Code 2304 SQLSTATE 09000
|
| Has anyone seen this error before? I searched google on this error and
found other people asking the exact same question I'm asking here, but I
never found any solutions.
|
| If Jon is reading this,
|
| is it possible to use ADOLISP with Oracle Standard? And how important is
it to use dbConnect with regards to keeping AutoCAD and database synched if
all of my data is stored in database and NONE in attributes?
|
| Thanks to anyone for their time.
|
| Robert
Robert Broussard
2003-12-30 18:39:05 UTC
Permalink
Robert Bell,

Where can I find a good reference for CAO? Would I have to use VB? Jon Flemming mentioned "AutoCAD Database Connectivity", Scott McFarlane as a good reference for AutoCAD database programming, but then he said "The CAO stuff is a little out of date for AutoCAD 2002 and more out of date for AutoCAD 2004."

Right now we're using Map 6 (2002), This afternoon I'll try viewing the MYSQL tables from dbconnect in AutoCAD 2004 and see if these errors were fixed in the later version.

Thanks,

Robert
R. Robert Bell
2003-12-31 03:01:46 UTC
Permalink
I agree with James. If you are on Map, use Map's tools.

CAO is documented in the online <F1> help in the Developer's Guide. Scott's
book is still valid for vanilla AutoCAD, in spite of the CAO changes, but
you have Map...
--
R. Robert Bell, MCSE
www.AcadX.com


"James Murphy" <***@bellsouth.net> wrote in message news:***@statler...
| Robert,( Broussard)
|
| Are you connecting to MySQL with the MAP tools in Map6 or using dbconnect?
| The map tools work a lot better in case you didn't know it. I was also
| getting some errors with MySQL using Map2004. I decided not to mess with
it
| anymore but not because of MySQL but because the third party program that
| was creating the dbase/tables wasn't working consistence.
|
| Murph
|
| "Robert Broussard" <***@autodesk.com> wrote in message
| news:***@jiveforum2.autodesk.com...
| > Robert Bell,
| >
| > Where can I find a good reference for CAO? Would I have to use VB? Jon
| Flemming mentioned "AutoCAD Database Connectivity", Scott McFarlane as a
| good reference for AutoCAD database programming, but then he said "The CAO
| stuff is a little out of date for AutoCAD 2002 and more out of date for
| AutoCAD 2004."
| >
| > Right now we're using Map 6 (2002), This afternoon I'll try viewing the
| MYSQL tables from dbconnect in AutoCAD 2004 and see if these errors were
| fixed in the later version.
| >
| > Thanks,
| >
| > Robert
|
|
James Murphy
2003-12-31 02:52:43 UTC
Permalink
Robert,( Broussard)

Are you connecting to MySQL with the MAP tools in Map6 or using dbconnect?
The map tools work a lot better in case you didn't know it. I was also
getting some errors with MySQL using Map2004. I decided not to mess with it
anymore but not because of MySQL but because the third party program that
was creating the dbase/tables wasn't working consistence.

Murph
Post by R. Robert Bell
Robert Bell,
Where can I find a good reference for CAO? Would I have to use VB? Jon
Flemming mentioned "AutoCAD Database Connectivity", Scott McFarlane as a
good reference for AutoCAD database programming, but then he said "The CAO
stuff is a little out of date for AutoCAD 2002 and more out of date for
AutoCAD 2004."
Post by R. Robert Bell
Right now we're using Map 6 (2002), This afternoon I'll try viewing the
MYSQL tables from dbconnect in AutoCAD 2004 and see if these errors were
fixed in the later version.
Post by R. Robert Bell
Thanks,
Robert
Jon Fleming
2004-01-09 10:17:51 UTC
Permalink
Great!

Those SQL logs do indeed grow. I left it on by mistake for a few days once, and ran
out of disk space.

You should submit a report at
<http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=1073063> (or search the
site for "bug report" if that URL doesn't work).

I'd report it to ADN but the ADN web site is down now.
--
jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services
I found the problem!!!
I used the Tracing function on Windows 2000 ODBC Data Source Administrator to create
a SQL.log file (a suggestion I found while searching these threads, thanks again
Jon). All of the following steps were recorded in the log file.
1. I started AutoCAD Map 6.
2. Then double clicked the data sourse
3. Double clicked the "Data Sources" folder in the project
4. Attached my udl file to the current drawing.
5. Double clicked one of the tables and viewed it (Read Only)
6. Started dbconnect.
7. Double clicked on one of the tables
8. Got the same $#% error.
9. Closed down AutoCAD.
The log file created was surprisingly a half a meg large. After searching through
all the text I think I found the culpret. When you double click a table in dbconnect
SELECT COUNT (*) FROM pole
Please notice that there is a single SPACE between the word "COUNT" and the open
bracket "(". That is a problem in mysql. An error message appeared a few lines down
DIAG [37000] [MySQL][ODBC 3.51 Driver][mysqld-4.0.15]You have an error in your SQL
syntax. Check the manual that corresponds to your MySQL server version for the right
syntax to use near '(*) FROM pole' at line 1 (1064)
I ran the correct query and the incorrect query (the one AutoCAD used) directly from
CORRECT QUERY SYNTAX
mysql> select count(*) from pole;
+----------+
| count(*) |
+----------+
| 13 |
+----------+
1 row in set (0.00 sec)
INCORRECT QUERY SYNTAX, NOTICE THE SPACE AFTER COUNT.
mysql> select count (*) from pole;
ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds
to your MySQL server version for the right syntax to use near '(*) from pole' at
line 1
mysql>
Both error messages match up. By the way they didn't fix this in AutoCAD 2004
because I get the same error.
I hope this helps anyone trying to connect AutoCAD to mysql with dbconnect. I am
going to try and make the developers aware if they aren't already.
I small snippit of the log file is attached if anyone wants to view it. I have to
entire half a meg log file if anyone wants that.
Robert
[Message contains attachment(s). Extract sql_log.zip?]
Jon Fleming
2003-12-31 14:15:37 UTC
Permalink
Post by Robert Broussard
is it possible to use ADOLISP with Oracle Standard?
I beleive so, although I haven't done it myself. Thre have been some
newsgroupmessages about oracle; search this newsgroup.
Post by Robert Broussard
And how important is it to use
dbConnect with regards to keeping AutoCAD and database synched if all of my data is
stored in database and NONE in attributes?
dbConnect is just a front-end for ADO and some CAO, so it's not at all
necessary. I don't quite agree with Mr. Bell about CAO; it's great for some things
but not useful for others. Whether ot not you should use it depends on the situation,
--
jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services
R. Robert Bell
2003-12-31 20:00:34 UTC
Permalink
"Jon Fleming" <***@fleming-group.com> wrote in message news:***@fleming-group.com...
| In article <***@jiveforum1.autodesk.com>,
Robert
| Broussard wrote:
| > is it possible to use ADOLISP with Oracle Standard?
|
| I beleive so, although I haven't done it myself. Thre have been some
| newsgroupmessages about oracle; search this newsgroup.
|
| > And how important is it to use
| > dbConnect with regards to keeping AutoCAD and database synched if all of
my data is
| > stored in database and NONE in attributes?
|
| dbConnect is just a front-end for ADO and some CAO, so it's not at all
| necessary. I don't quite agree with Mr. Bell about CAO; it's great for
some things
| but not useful for others. Whether ot not you should use it depends on
the situation,
|

So true. Blanket statements should always be avoided. Do'h! There I go
again...
nailbombjoe
2005-02-01 17:00:52 UTC
Permalink
How did you get the connection to MySQL to work? I've been trying to get dbconnect to connect to a MySQL server and I have had no luck. I've installed the ODBC driver from the MySQL and it works when I test it from the control panel. But if I try and connect from dbconnect I get the following error:

Test connection failed because of an error in initializing provider. Unexpected failure.

Thanks.
Jon Fleming
2005-02-02 13:38:57 UTC
Permalink
Stephan Koster claims to have found the solution recently, in
<http://groups-beta.google.com/group/autodesk.autocad.connectivity/msg/d58035d55ba3d50d
"I looked at the mentioned thread and there Robert Broussard wrote that
the problem is the extra space in the query:

SELECT COUNT (*) FROM tablename

he means the space after 'COUNT'

In the MySQL OBDC-driver there is an option to ignore this space:
Go to the ODBC settings in the Control Panel, select your MySQL-DSN,
click 'Configure...' and then 'Options >>' and then enable
'Ignore Space After Function Names'.

With this setting enabled, dbconnect works for me."
--
jrf
Autodesk Discussion Group Facilitator
Please do not email questions unless you wish to hire my services
Post by nailbombjoe
How did you get the connection to MySQL to work? I've been trying to get dbconnect
to connect to a MySQL server and I have had no luck. I've installed the ODBC driver
from the MySQL and it works when I test it from the control panel. But if I try
Test connection failed because of an error in initializing provider. Unexpected failure.
Thanks.
Loading...