• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

Access 2003/2007 and iSeries ODBC

We are running Access 2007.  

We are able to update an MDB format version of the database in question.

We created a new ACCDB database and imported all queries/tables/etc from the MDB.  We deleted and relinked all ODBC tables with keys defined.  

The same make-table query now bombs with an ODBC call-failed message ("SQL data type argument out of range (#30030)".

Any suggestions?
0
ParisBP
Asked:
ParisBP
  • 8
  • 6
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi Paris,

This kind of error is almost always on the client side, so let's look at what can cause it.

1.  Are you recreating the database on the same desktop computer that housed it previously?  If it's a different computer, what's different.

2.  What's different on the desktop computer?  Has the O/S been upgraded?  Has the O/S changed?  Are there new database utilities that may have overwritten the ODBC driver or modified the system registries regarding the driver?  Have any of the Microsoft Office products been updated?

3.  Are you connecting to the same database or a different database on the same server?

4.  Can you create a brand new Access database and link the AS400 tables from the new database?


Let's start there....
Kent
0
 
Bill RossCommented:
Hi,

Please post the SQL for the make table query that is failing.

Regards,

Bill
0
 
ParisBPAuthor Commented:
1.  Same computer (running Acc2007) that currently updates the MDB version of the database.
2.  No changes to OS, driver, etc.
3.  Now connecting to an ACCDB formatted database, same server.
4.  That's what we did...created the new ACCDB object, then imported the objects from the MDB.  Connected to the iSeries tables via new ODBC linked-tables and defined keys on each one.

Maketable query is copied below.

SELECT PB3555AFPL_SRBSOH.OHCUNO, PB3555AFPL_SRBSOH.OHNAME, PB3555AFPL_SRBSOL.OLORNO, PB3555AFPL_SRBSOL.OLLINE, PB3555AFPL_SRBSOL.OLSROM, PB3555AFPL_SRBSOL.OLPRDC, PB3555AFPL_SRBSOL.OLOQTS, IIf([OLFOCC]='Y',0,[OLSCPR]) AS OLSALP, [OLOQTS]*IIf([PB3555AFPL_SRBSOL].[OLFOCC]='Y',0,[PB3555AFPL_SRBSOL].[OLSCPR]) AS Expr1, PB3555AFPL_SRBPRG.PGAPCO, DateValue(Now()-1) AS Expr4, PB3555AFPL_SRBSOL.OLDELT, PB3555AFPL_SRBSOL.OLRDDT, PB3555AFPL_SRBCTLDG.CTAGRD, PB3555AFPL_SRBSOL.OLORDT, PB3555AFPL_SRBPRG.PGAGRP, PB3555AFPL_SRBSOL.OLSTAT, PB3555AFPL_SRBSOL.OLORDS, PB3555AFPL_SRBSOL.OLBALC, PB3555AFPL_SRBSOL.OLFICC, Int([OHODAT]) AS Expr2, Int((10000*(Year(DateValue(Now()-1)))+(100*Month(DateValue(Now()-1)))+Day(DateValue(Now()-1)))) AS RunDate, PB3555AFPL_SRONAM.NAAREA, PB3555AFPL_SRBSOL.OLPOTP, [OLOQTS]*[PGAPCO] AS ExtCost, PB3555AFPL_SRBSOH.OHODAT, Left([PGAGRP],2) AS AcctBreak, Int((10000*(Year(DateValue(Now()-7)))+(100*Month(DateValue(Now()-7)))+Day(DateValue(Now()-7)))) AS RunDate2, PB3555AFPL_SRBSOH.OHSALE AS HdrSalesman, PB3555AFPL_SRBSOH.OHOREF AS CustPO INTO ASWOrderInbound
FROM (((PB3555AFPL_SRBSOL INNER JOIN PB3555AFPL_SRBSOH ON PB3555AFPL_SRBSOL.OLORNO = PB3555AFPL_SRBSOH.OHORNO) INNER JOIN PB3555AFPL_SRBPRG ON PB3555AFPL_SRBSOL.OLPRDC = PB3555AFPL_SRBPRG.PGPRDC) INNER JOIN PB3555AFPL_SRBCTLDG ON PB3555AFPL_SRBPRG.PGAGRP = PB3555AFPL_SRBCTLDG.CTAGRN) INNER JOIN PB3555AFPL_SRONAM ON PB3555AFPL_SRBSOL.OLCUNO = PB3555AFPL_SRONAM.NANUM
WHERE (((PB3555AFPL_SRBSOL.OLOQTS)>0) AND ((PB3555AFPL_SRBSOL.OLORDT) Not In ('IR','CI','CN','CR','CS')) AND ((PB3555AFPL_SRBSOL.OLSTAT)<>'D') AND ((PB3555AFPL_SRBSOL.OLFICC)<>'Y') AND ((PB3555AFPL_SRBSOH.OHODAT)>=20100101));
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Bill RossCommented:
Hi,

I would change the following expressions in the query for return values of LONG:

CLng(Int([OHODAT])) AS Expr2

CLng(Int((10000*(Year(DateValue(Now()-1)))+(100*Month(DateValue(Now()-1)))+Day(DateValue(Now()-1))))) AS RunDate

CLng(Int((10000*(Year(DateValue(Now()-7)))+(100*Month(DateValue(Now()-7)))+Day(DateValue(Now()-7))))) AS RunDate2

The MakeTable query may be attempting to create the wrong data types in the new table.  The best way to handle this is to create a blank table with correct data types.  Run a delete query to clear the table then an append query to add the data.

Using a MakeTable requires the query generator to figure out the desired data types.

I suspect the query optimizer works differently in 2003 vs. 2007.

Regards,

Bill
0
 
ParisBPAuthor Commented:
Clng changes in the make-table didn't work.  Using delete/append methodology also failed.
0
 
Bill RossCommented:
Hi,

OK.

Make a backup of the query.

Change the Maketable query to a select query and inspect the results.  Look at each field closely and check for data that might be problematic.  

Remove the 3 computed fields and see if the make table works.  If so then the computations are problematic - if not then there is a data issue that should be seen from above.

Try and limit the result set to one record and see if the Maketable works.

We'll figure it out.

Bill
0
 
Bill RossCommented:
Hi,

Additionally - I would expect the "("SQL data type argument out of range (#30030)" error to be because a date numeric value is beyond scope.  Look at very large numbers or dates before 1/1/1800, etc.

Bill
0
 
ParisBPAuthor Commented:
Took out the three fields we applied Clng to...changed to select query...failed.

Very odd...the same machine updates the same query in the MDB version every night without incident...and after doing the import of the query to a clean ACCDB, it's failing.
0
 
Bill RossCommented:
Did you inspect the data for out of range values?

Did you test a single row of data?

2007 may handle values more strictly than 2003 due to integration with SQL.

Look at the result set closely...

Bill
0
 
Bill RossCommented:
Did I read that right - the SELECT query fails?

If so, then delete half the fields and test.  If that fails the delete another half.  Find the one or more fields that have bad (out of range) data.

Bill
0
 
ParisBPAuthor Commented:
Yes, the select failed.  Tried pulling in only a few records (for a single sales order)...still bombed.  

2007 is able to process the same query in the MDB version without incident...so it's something with how it handles ACCDB and queries within that format.  Just doesn't make a lot of sense right now.
0
 
Bill RossCommented:
I still believe it's a data issue as 2007 is much more restrictive than 2003 due to SharePoint and SQL integration.  For mdb's that integration is "dumbed down".

I know it's tedious but eliminate the joins and look at the nate data.  Build the query from scratch to find the issue.

Bill
0
 
ParisBPAuthor Commented:
OK...will deconstruct/reconstruct and see where that takes us...
0
 
ParisBPAuthor Commented:
Got it working....One of the tables in the query was a physical file linked to the backend.  Based on something else I saw (in comparing to another query that worked), I changed it to link to its logical file on the backend...and now it runs fine.  Didn't have any trouble with the date manipulations or substrings or IIf calculations, and the rest of the query is pretty simple.

We've got quite a few more of these to go, but now I know to check the physical/logical things first when/if the 30030's crop up.  

Thanks much for your help.
0
 
Bill RossCommented:
Great!!!

Let me know if I can help further...

Bill
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now