Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run Query w/Function from Excel

I hate to post a repeat of a previous post but, the reply
I received didn't quite solve my problem.
I have query in Access with a function that I wrote as
one of the fields. My problem is that when I try to run
the query from Excel using ADODB.Command I get the
following error: "Run-time error '-2147217900(80040e14)':
Undefined function 'Function Name' in expression.." This
query is a parameter query so, I need to be able to pass
the parameters to the it. This also happens when using
the "NZ" function in a Access query.
I can rule out a need for a reference being set to the
ADO Interface or Access Object Model.

Thanks in advance,

Kev

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Run Query w/Function from Excel

This may be silly question but why don't you just run the query from excel using a recordset or execute statment?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run Query w/Function from Excel

Instead of using the ADO command object, just use straight
text and for Nz, just write your own function in Excel

Dim ..., RS As ADODB.RecordSet
....
strSql = Select fld1, fld2, yourNz(fld3) from tbl1"
RS.Open strSql, conn, , adOpenDynamic, adLockPessimistic
Sheet1.Range("A1").CopyFromRecordset
....

Rich P

-----Original Message-----
I hate to post a repeat of a previous post but, the reply
I received didn't quite solve my problem.
I have query in Access with a function that I wrote as
one of the fields. My problem is that when I try to run
the query from Excel using ADODB.Command I get the
following error: "Run-time error '-2147217900(80040e14)':
Undefined function 'Function Name' in expression.." This
query is a parameter query so, I need to be able to pass
the parameters to the it. This also happens when using
the "NZ" function in a Access query.
I can rule out a need for a reference being set to the
ADO Interface or Access Object Model.

Thanks in advance,

Kev

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Run Query w/Function from Excel

This didn't work for me. I wrote my own public function called yourNZ
in a standard module in Excel but when I tried to use it in a query I
got an error: "Undefined function 'yourNZ' in expression."

--

"Rich P" wrote in message ...
Instead of using the ADO command object, just use straight
text and for Nz, just write your own function in Excel

Dim ..., RS As ADODB.RecordSet
...
strSql = Select fld1, fld2, yourNz(fld3) from tbl1"
RS.Open strSql, conn, , adOpenDynamic, adLockPessimistic
Sheet1.Range("A1").CopyFromRecordset
...

Rich P

-----Original Message-----
I hate to post a repeat of a previous post but, the reply
I received didn't quite solve my problem.
I have query in Access with a function that I wrote as
one of the fields. My problem is that when I try to run
the query from Excel using ADODB.Command I get the
following error: "Run-time error '-2147217900(80040e14)':
Undefined function 'Function Name' in expression.." This
query is a parameter query so, I need to be able to pass
the parameters to the it. This also happens when using
the "NZ" function in a Access query.
I can rule out a need for a reference being set to the
ADO Interface or Access Object Model.

Thanks in advance,

Kev

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query SQL Data in Excel with a function? FullCity Consulting Inc. Excel Worksheet Functions 1 November 13th 07 05:26 AM
SQL & Like Query function in excel George Applegate[_2_] Excel Worksheet Functions 0 November 1st 07 03:55 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
Run Query w/Function from Excel Kev[_4_] Excel Programming 1 December 18th 03 07:53 PM
Excel Web Query Function Steven Baroni Excel Programming 3 December 8th 03 10:49 PM


All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"