For Programmers: Free Programming Magazines  


Home > Archive > Clarion > February 2005 > Connecting to MySQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Connecting to MySQL
James O Brien

2005-02-05, 8:55 pm

Hello,
Sorry about the long post, but I thought it best to give all the
details....
I am trying to connect a Clarion program to MySQL through ODBC. I am
using the same code that I used to connect with MSSQL and Oracle. I am
using MySQL version 4.1, and mysql odbc driver version 3.51.

My issue is the the clarion command open() does not seem to work at
all. This prevents me from using any other clarion commands, as the
file structure is not open.

example:

FTEST
FILE,DRIVER('ODBC'),OWNER(DataSource),NA
ME(sTestName),PRE(tes),CREATE,BINDABLE
P
KEY(tes:ID),NOCASE,OPE,PRIMARY
Record RECORD,PRE()
ID LONG
END
END


code
sTestName = 'dbName.test'
DataSource='MySQLDSN,userName,password'

create(fTest)
if errocode() then message(fileerror(),error()).


open(fTest)
if errocode() then message(fileerror(),error()).


Within the code above there is no problem with the create command. The
table does get created within the database. It is when I try and open
the file that I start having problems.

Below is the clarion odbc trace for that first pass when I am creating
the table:
0C98H(1) 14:28:16.597 CREATE(avenio.test:04CC254H) Time Taken:0.40
secs
0C98H(1) 14:28:16.597 GET_PROPERTY(avenio.test:04CC254H) Time
Taken:0.00 secs
0C98H(1) 14:28:39.299 Allocating Statement 0E123F0H on Connection
0E11348H Time Taken:0.00 secs
0C98H(1) 14:28:39.299 Getting columns for avenio.test using Statement
0E123F0H Time Taken:0.00 secs
0C98H(1) 14:28:39.299 Binding Column 4 to C type CHAR(129) for
Statement 0E123F0H Time Taken:0.00 secs
0C98H(1) 14:28:39.299 Fetching Row from Statement 0E123F0H Return
Code: 100 Time Taken:0.00 secs
0C98H(1) 14:28:39.299 Unbinding Columns Statement 0E123F0H Time
Taken:0.00 secs
0C98H(1) 14:28:39.299 Closing Statement 0E123F0H Time Taken:0.00 secs
0C98H(1) 14:28:39.299 Freeing Statement 0E123F0H Time Taken:0.00 secs
0C98H(1) 14:28:39.299 OPEN(avenio.test:04CC254H) Error: File Not Found
Time Taken:0.00 secs


On further passes, ie when the create statement is commented out.....
I sometimes get the error when connecting, other times just the file
not found like above.

0E98H(1) 14:39:50.224 Connecting to DSN=aveniomysql; UID=root;
PWD=********;
0E98H(1) 14:39:50.234 Error Occurred: IM008 [MySQL][ODBC 3.51
Driver]Invalid window handle for connection completion argument.


This error message continues to come up when trying to open etc....


From this, i can only assume that the error is with my connection....
I have know idea why it would work when I am creating a table... but
it does seem to. Also there is no problems if I use the prop:sql to
send commands to the database rather than clarion code..ie
fileName{prop:sql} = 'insert into test values(10)'

Any help or ideas would be appreciated.....

Thanks,
James
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com