Alaska Software Inc. - Session does not support SQL (DACSQLSTATEMENT)
Username: Password:
AuthorTopic: Session does not support SQL (DACSQLSTATEMENT)
+¦kos De+¦kSession does not support SQL (DACSQLSTATEMENT)
on Sat, 12 Jan 2019 22:16:02 +0100
Dear all!

I recently upgraded from Xbase++ 1.9.355 to 2.0. I've been using MySQL as my
primally data server for many years. I would like to use the SQLStatement
Class to do querys (SELECT), execute sql commands (INSERT, UPDATE, etc), but
it doesn't work for me. I create a new session that successfully connects to
the server, but when I want to create an sqlstatement object I get a runtime
error.

"ERROR:Session does not support SQL (DACSQLSTATEMENT)"

Here is my sample code:

cConnStr := "DBE=ODBCDBE;DRIVER={MySQL ODBC 5.3 ANSI
Driver};SERVER=localhost;DB=testDB;UID=user;PWD=passwd;"

oSql := DacSession():New( cConnStr )

IF .NOT. oSql:isConnected()
*  MsgBox( "Error code : " + oSession:getLastError() )
   MsgBox( "Description: " + oSession:getLastMessage() )
ELSE
   MsgBox( "Connection to server established." )
ENDIF

cCmd := "INSERT INTO test_table (Name) VALUES ('Joseph');"

    ... this is where the problem begins ...
oSqlStmt := DacSqlStatement(oSql):fromChar(cCmd)  -

DacSqlStatement(oSql) gives me the above mentioned error message...

Commands I used in Alaska 1.9 still work, like SQL CMD, SQL (cCmd) INTO xVar,
etc. Interestingly enough I cannot find these commands in the new documentation. 

Can somebody tell me what am I doing wrong? 

Thanks in advance,
Akos Deak
Andreas Gehrs-Pahl
Re: Session does not support SQL (DACSQLSTATEMENT)
on Sun, 13 Jan 2019 11:19:16 -0500
Akos,

>"ERROR:Session does not support SQL (DACSQLSTATEMENT)"

The ODBCDBE doesn't support the DacSqlStatement (class), as the (required) 
OdbcSqlStatement subclass hasn't been implemented (yet). Only the following 
(DBE-specific) classes: PgSqlStatement, AdsSqlStatement and USqlStatement 
exist so far (for PGDBE, ADSDBE, and Universal SQL). Universal SQL can also 
use the internal (local or client-side-only) SQLite (DBE), and can be used 
with Non-SQL DBEs as well as Arrays, DataObjects, and other memory 
variables.

With the ODBCDBE you can only use the SQL command or the corresponding 
SqlCmd(), SqlStmtExec(), SqlGetResult(), and SqlExecSp() functions.

Alternatively, you could use SQLExpress from Boris instead of the ODBCDBE, 
which is working very well.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC
+¦kos De+¦kRe: Session does not support SQL (DACSQLSTATEMENT)
on Mon, 14 Jan 2019 09:03:38 +0100
Hello Andreas,

Thanks you for the detailed answer!  

Maybe this line from the documentation confused me.

"SqlStatement implementes build and exection of SQL Statements for ALL Xbase++
DatabaseEngines."

I thought this includes odbcdbe.
Ok, then i'll use the old methods for a time being. I don't find the functions
you mentioned in the documentation by the way (SqlCmd(), SqlStmtExec(),
SqlGetResult(), and SqlExecSp()) 

Regards,
Akos

Andreas Gehrs-Pahl wrote in message
news:7nrlwiya6idf.zyc77k9i54hf$.dlg@40tude.net...
>Akos,
>
>>"ERROR:Session does not support SQL (DACSQLSTATEMENT)"
>
>The ODBCDBE doesn't support the DacSqlStatement (class), as the (required) 
>OdbcSqlStatement subclass hasn't been implemented (yet). Only the following 
>(DBE-specific) classes: PgSqlStatement, AdsSqlStatement and USqlStatement 
>exist so far (for PGDBE, ADSDBE, and Universal SQL). Universal SQL can also 
>use the internal (local or client-side-only) SQLite (DBE), and can be used 
>with Non-SQL DBEs as well as Arrays, DataObjects, and other memory 
>variables.
>
>With the ODBCDBE you can only use the SQL command or the corresponding 
>SqlCmd(), SqlStmtExec(), SqlGetResult(), and SqlExecSp() functions.
>
>Alternatively, you could use SQLExpress from Boris instead of the ODBCDBE, 
>which is working very well.
>
>Hope that helps,
>
>Andreas
Jim LeeRe: Session does not support SQL (DACSQLSTATEMENT)
on Sun, 13 Jan 2019 23:33:03 +0100
hi,

> I recently upgraded from Xbase++ 1.9.355 to 2.0. I've been using MySQL as
> my
> primally data server for many years. I would like to use the SQLStatement
> Class to do querys (SELECT), execute sql commands (INSERT, UPDATE, etc), 
> but
> it doesn't work for me. I create a new session that successfully connects
> to
> the server, but when I want to create an sqlstatement object I get a
> runtime
> error.

so you say it work with v1.9 but not with v2.0 ?
is it still same PC and OS() ?

i use MySQL native with CLASS MySQL from Hector Pezoa using ot4xb.
it use libmySQL.dll (32bit Version) direct. you will find it at
www.xbwin.com




---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com
+¦kos De+¦kRe: Session does not support SQL (DACSQLSTATEMENT)
on Mon, 14 Jan 2019 09:21:28 +0100
Hi Jim,

No, I used SQL CMD, SQL cCmd INTO xVar, USE (cCmd) ALIAS test NEW, etc in
Xbase 1.9 and it worked just fine. I wanted to try new things like
SqlStatemnet in Xbase 2.0, but as Andreas mentioned above it won't work with
odbcdbe for a time being. I  saw Hectors' native MySQL class, maybe I give it
a try. 

Regards,
Akos

Jim Lee wrote in message news:2eb30c40$7ba1d3f1$fa306@news.alaska-software.com...
>hi,
>
>> I recently upgraded from Xbase++ 1.9.355 to 2.0. I've been using MySQL as
>> my
>> primally data server for many years. I would like to use the SQLStatement
>> Class to do querys (SELECT), execute sql commands (INSERT, UPDATE, etc), 
>> but
>> it doesn't work for me. I create a new session that successfully connects
>> to
>> the server, but when I want to create an sqlstatement object I get a
>> runtime
>> error.
>
>so you say it work with v1.9 but not with v2.0 ?
>is it still same PC and OS() ?
>
>i use MySQL native with CLASS MySQL from Hector Pezoa using ot4xb.
>it use libmySQL.dll (32bit Version) direct. you will find it at
>www.xbwin.com
>
>
>
>
>---
>Diese E-Mail wurde von AVG auf Viren geprüft.
>http://www.avg.com