Connecting Tech Pros Worldwide Help | Site Map

Calling a function built in access in a query to Oracle through ODBC

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 04:22 PM
Peter Monica
Guest
 
Posts: n/a
Default Calling a function built in access in a query to Oracle through ODBC

I am trying to calculate distance from a point entered by a user usng
a function in Access in a query that calls tables in an Oracle
database as well as in Access. I am getting the following message:

Undefined function 'Distance' in expression.

Here is the query:

SELECT people.first_name
, jobs.job
, job_types.job_type_description
, Distance(DLookUp("latitude","ZIP_CODES","zip = " &
[Forms]![testform]![Combo4]),DLookUp("longitude","ZIP_CODES","zip = "
& [Forms]![testform]![Combo4]),[addresses]![LATITUDE],[addresses]![LONGITUDE],True)
AS Miles
FROM (job_types INNER JOIN (people INNER JOIN jobs ON people.people_id
= jobs.people_id) ON job_types.job_type = jobs.job_type) INNER JOIN
addresses ON people.people_id = addresses.people_id
WHERE (((specialty_mapping.panel_specialty)=[Forms]![testform]![Combo0]));

OK, so the table names have been changed, but here's where each
resides:
people - Oracle
jobs - Oracle
addresses - Oracle
job_types - Access
zip_codes - Oracle

Also, the function I am using (Distance) does work, and is a Public
Function in the database.

Any ideas?

Thanks!

  #2  
Old November 12th, 2005, 04:22 PM
DFS
Guest
 
Posts: n/a
Default Re: Calling a function built in access in a query to Oracle through ODBC

Looks like your latitude and longitude arguments aren't syntaxed correctly.
Also I see you're referencing Zip Codes using a number syntax. Zip Codes
should be stored and used as if they were text, because some start with 0.

Try:

Distance(
DLookUp("latitude","ZIP_CODES","zip = '" & [Forms]![testform]![Combo4] &
"'"),
DLookUp("longitude","ZIP_CODES","zip = '" & [Forms]![testform]![Combo4] &
"'"),
[addresses]![LATITUDE],
[addresses]![LONGITUDE],
True)
AS Miles


"Peter Monica" <peter_monica@concentra.com> wrote in message
news:42fcba.0312041156.396defba@posting.google.com ...[color=blue]
> I am trying to calculate distance from a point entered by a user usng
> a function in Access in a query that calls tables in an Oracle
> database as well as in Access. I am getting the following message:
>
> Undefined function 'Distance' in expression.
>
> Here is the query:
>
> SELECT people.first_name
> , jobs.job
> , job_types.job_type_description
> , Distance(DLookUp("latitude","ZIP_CODES","zip = " &
> [Forms]![testform]![Combo4]),DLookUp("longitude","ZIP_CODES","zip = "
> &[/color]
[Forms]![testform]![Combo4]),[addresses]![LATITUDE],[addresses]![LONGITUDE],
True)[color=blue]
> AS Miles
> FROM (job_types INNER JOIN (people INNER JOIN jobs ON people.people_id
> = jobs.people_id) ON job_types.job_type = jobs.job_type) INNER JOIN
> addresses ON people.people_id = addresses.people_id
> WHERE (((specialty_mapping.panel_specialty)=[Forms]![testform]![Combo0]));
>
> OK, so the table names have been changed, but here's where each
> resides:
> people - Oracle
> jobs - Oracle
> addresses - Oracle
> job_types - Access
> zip_codes - Oracle
>
> Also, the function I am using (Distance) does work, and is a Public
> Function in the database.
>
> Any ideas?
>
> Thanks![/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.