ADO: VBA function in select statement 
Author Message
 ADO: VBA function in select statement

I have a problem accesing a recordset (query) of an Access database from
VC++.

The query is of the form:

select vba_func(aField) from Table;

The ODBC Driver refuses to process the statement with the following message:

[Microsoft][ODBC Driver] undefined function vba_func in expresion.

The same statement work fine under ORACLE.

Any suggestions?!

Christian Bartling



Sun, 21 Oct 2001 03:00:00 GMT  
 ADO: VBA function in select statement


Fri, 19 Jun 1992 00:00:00 GMT  
 ADO: VBA function in select statement

Perhaps I should provide some additional information:

The program is a VC++ 6.0 front end using ADO 2.1

rsRep->SetAnActiveConnection
rsRep->CursorLocation = adUseServer;
rsRep->Open(_bstr_t("select vba_func(aField) from Table"),
vNull,adOpenStatic,adLockReadOnly,adCmdText);

                                                   *** Exception ***

[Microsoft][ODBC Driver] undefined function vba_func in expression

Christian Bartling



Sun, 21 Oct 2001 03:00:00 GMT  
 ADO: VBA function in select statement
The OLE DB Provider for JET and all the MS Access ODBC drivers do not
support the use of MS Access's user-defined function in SQL queries. What
this means is that if you run an SQL query from within Access you can call
any VBA function defined with global scope in a module in the .MDB file. If
you run the same query through ODBC or OLE-DB (including ADO/RDS) then the
VBA function will cause a User-defined function error.

If this is a must have feature then you can consider Automatiing an instance
of MS Access to run your query for you. Definitely for low
concurrency/performance situations only. A light-weight, full function SQL
Server such as Sybase Adaptive Server Anywhere (used to be SQL Anywhere)
might be the way forward here if MS SQL Server/Oracle/Sybase Adaptive Server
Enterprise are considered overkill.

                      \\|//
                    (o o)
~~~~oOOo~(_)~oOOo~~~~
Regards,

Tonix
MCP+Internet, MCSD

Quote:

>Perhaps I should provide some additional information:

>The program is a VC++ 6.0 front end using ADO 2.1

>rsRep->SetAnActiveConnection
>rsRep->CursorLocation = adUseServer;
>rsRep->Open(_bstr_t("select vba_func(aField) from Table"),
>vNull,adOpenStatic,adLockReadOnly,adCmdText);

>                                                   *** Exception ***

>[Microsoft][ODBC Driver] undefined function vba_func in expression

>Christian Bartling




Sun, 21 Oct 2001 03:00:00 GMT  
 ADO: VBA function in select statement
You can execute Visual FoxPro user-defined functions from outside FoxPro
environment. I tried it once from Access via SQL-passthrough query.


Quote:
> I have a problem accesing a recordset (query) of an Access database from
> VC++.

> The query is of the form:

> select vba_func(aField) from Table;

> The ODBC Driver refuses to process the statement with the following
message:

> [Microsoft][ODBC Driver] undefined function vba_func in expresion.

> The same statement work fine under ORACLE.

> Any suggestions?!

> Christian Bartling




Mon, 22 Oct 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ADO: VBA function in select statement

2. Access: Err 2342 in SQL SELECT Statement in VBA

3. Access: Err 2342 in SQL SELECT Statement in VBA

4. ADO and a simple select statement !

5. ADO/Sybase...Need SELECT statement that will only return 1 row

6. ado native error 16997 on Select statement

7. strange beheviour with select statement using ado/paradox

8. Problem with [Select into Where] SQL Statement/ADO

9. Please Help: Long select statement for ADO

10. Problem with number data type in ADO Select SQL statement

11. Problem with number data type in ADO Select SQL statement

12. VBA Functions in SQL Statement

 

 
Powered by phpBB® Forum Software