472,374 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Using "DB2 Friendly" Commands in Access Query - InStr v. POSSTR

All -

I have the following in the Field row of a column in a query that runs
fine against a local table:

MSA: InStr([Forms]![frm_Browse1]![tb_strSQL],[CONTENT]![FL1])

I'm now trying to run the query against a linked DB2 table. I get a
"Connection Failed" error.

I think I understand 2 things from other posts:

1. DB2 is not going to accept this because of my use of the InStr.

2. The DB2 equivalent of InStr is POSSTR.

So I've modified the query so it reads:

MSA: POSSTR([Forms]![frm_Browse1]![tb_strSQL],[CONTENT]![FL1])

I get an "Undefined Function" error.

If what I think I know is true, how would I construct my field to use
POSSTR? I've tried lots of syntax variations with no joy.

If what I think I know is false, can someone point me in the correct
direction? Do I need to set up POSSTR in a module somehow?

Thanks,

Patrick

Nov 13 '05 #1
6 7400
Patrick A wrote:
All -

I have the following in the Field row of a column in a query that runs
fine against a local table:

MSA: InStr([Forms]![frm_Browse1]![tb_strSQL],[CONTENT]![FL1])

I'm now trying to run the query against a linked DB2 table. I get a
"Connection Failed" error.

I think I understand 2 things from other posts:

1. DB2 is not going to accept this because of my use of the InStr.

2. The DB2 equivalent of InStr is POSSTR.

So I've modified the query so it reads:

MSA: POSSTR([Forms]![frm_Browse1]![tb_strSQL],[CONTENT]![FL1])

I get an "Undefined Function" error.

If what I think I know is true, how would I construct my field to use
POSSTR? I've tried lots of syntax variations with no joy.

If what I think I know is false, can someone point me in the correct
direction? Do I need to set up POSSTR in a module somehow?

Thanks,

Patrick

Make the query a pass-through query. Then Jet doesn't evaluate the SQL
but instead sends it to the DB2 back-end where it is evaluated. Thus
you'll need to use DB2 SQL syntax and functions; it won't know anything
of VBA functions or Jet SQL Syntax.

With the query in design mode select Query, SQL Specific, Pass-Through
and the query will switch to a SQL editor where you can type in the DB2
SQL.

This should perform better as well since the processing takes place on
the server instead of in the front-end (depending on what your query
does all the records won't be dragged to the front-end first before
filtering for example).
--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #2
On 5 Apr 2005 15:42:58 -0700, "Patrick A" <me*****@butter.toast.net>
wrote:

If you want to use syntax that is understood by the server (and not
necessarily by Access), then you need to use a Passthrough query.

-Tom.

All -

I have the following in the Field row of a column in a query that runs
fine against a local table:

MSA: InStr([Forms]![frm_Browse1]![tb_strSQL],[CONTENT]![FL1])

I'm now trying to run the query against a linked DB2 table. I get a
"Connection Failed" error.

I think I understand 2 things from other posts:

1. DB2 is not going to accept this because of my use of the InStr.

2. The DB2 equivalent of InStr is POSSTR.

So I've modified the query so it reads:

MSA: POSSTR([Forms]![frm_Browse1]![tb_strSQL],[CONTENT]![FL1])

I get an "Undefined Function" error.

If what I think I know is true, how would I construct my field to use
POSSTR? I've tried lots of syntax variations with no joy.

If what I think I know is false, can someone point me in the correct
direction? Do I need to set up POSSTR in a module somehow?

Thanks,

Patrick


Nov 13 '05 #3
Thanks, guys - esp. for the Step=by-Step.

Pass through queries are new to me, but I'll give it a try, and post
the results.

Patrick

[Trimmed Previous]

Nov 13 '05 #4
Wow. There's a ton in my query that's apparently not in DB2 SQL
syntax, or is not using DB2 SQL functions.

Can anyone recommend a good book or other resource where I can learn
how to translate from VBA functions and Jet SQL syntax into the DB2
equivalent?

Thanks,

Patrick

Nov 13 '05 #5
Patrick A wrote:
Wow. There's a ton in my query that's apparently not in DB2 SQL
syntax, or is not using DB2 SQL functions.

Can anyone recommend a good book or other resource where I can learn
how to translate from VBA functions and Jet SQL syntax into the DB2
equivalent?


This site seems to have the DB2 Help file info:

https://aurora.vcu.edu/db2help/index.htm

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #6
Looks handy and detailed - I'll check into it. Thanks, MG

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Bruce Jin | last post by:
I wonder how many people are using db2 on Windows? I know db2 is native to AS400 which has about 800,000 installations. Thanks!
1
by: LazyAnt | last post by:
Does DB2 process "ALL" subquery by "nested iteration" strategy, or using its own special algorithm? For example, assume r(A, B, C) and s(D, E, F) are two relations, consider the following query:...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
0
by: Don | last post by:
Hello, I am having some troubles and was hoping for some help. I have created links to DB2 tables using DB2 Connect I have multiple queries that I run each day and I need to provide them...
4
by: Ray | last post by:
Does anyone out there have experience with using Db2 8.2 with a program called MISys (also known as ACCPAC). I am having some problems with the application running exteremly slow on workstations...
0
by: dhuygu | last post by:
How can I run db2 commands from .net application? I want to create a new database from my application.Then I want to copy a table from the database on server to my new local database.I'm using db2...
1
by: Siebbel | last post by:
Hello, I posted this problem already in the linux section but without positive result. Perhaps someone here has experienced the smae problem. I am pretty new with writing shell scripts and...
2
by: SrivalliBapathi | last post by:
Hi, Please help me, if theres a way we can execute DB2 commands directly from the windows cmd prompt window instead of executing those from DB2 CLP window. I need to connect to a DB2 database...
3
by: rajamurugank | last post by:
Hi, Good Morning friends, I am new in DB2 database.we have DB2(9.1) database on zLinux.I can access the DB using the admin user. But,i can't access the DB as a normal linux users. Now the...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.