ODBC--call failed

G

Guest

Hello,

I'm having a query problem with linked tables in SQL Server 2005.
The query has two tables with the following SQL statement:

SELECT tblCheckStock.ChStPartID, tblCheckStock.MRBLogNo, tblMRBData.Problem
FROM tblCheckStock INNER JOIN tblMRBData ON tblCheckStock.MRBLogNo =
tblMRBData.MRBLogNo
GROUP BY tblCheckStock.ChStPartID, tblCheckStock.MRBLogNo, tblMRBData.Problem
HAVING (((tblCheckStock.ChStPartID)=[Forms]![frmCheckStock]![cboPartID]))
ORDER BY tblCheckStock.MRBLogNo DESC;

As is, I get "ODBC--call failed" error without any error number. If I take
out "GROUP BY" the query works fine.

I'm running XP with msjet40.dll version 4.0.8618.0

I've tried KB303257, but I'm unable to duplicate the problem (i.e. I have no
problem).

Any help is appreciated

Thanx!

Isbjornen
 
G

Guest

I was able to "create" an error message:
[Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, and image
data types cannot be compared or sorted, except when using IS NULL or LIKE
operator. (#306)

I did not have this problem i SQL Server 7.0.
I'm using Access 2003

Isbjornen
 
J

John Spencer

Not sure why that should fail.

Have you tried the following, which should be equivalent to what you have
posted?

SELECT DISTINCT tblCheckStock.ChStPartID, tblCheckStock.MRBLogNo,
tblMRBData.Problem
FROM tblCheckStock INNER JOIN tblMRBData
ON tblCheckStock.MRBLogNo = tblMRBData.MRBLogNo
WHERE (((tblCheckStock.ChStPartID)=[Forms]![frmCheckStock]![cboPartID]))
ORDER BY tblCheckStock.MRBLogNo DESC;
 
G

Guest

Thanks, but it did not work. However, I found the solution:
tblMRBData.Problem is a Memo field and the SQL server does not GROUP BY on it
(GROUP BY Text fields are allowed though). BTW, Access has no problem with
GROUP BY on Memo fields. The solution for me was to sort/group as First
(i.e. FirstOfProblem)

Thank you for taking your time to look into it

John Spencer said:
Not sure why that should fail.

Have you tried the following, which should be equivalent to what you have
posted?

SELECT DISTINCT tblCheckStock.ChStPartID, tblCheckStock.MRBLogNo,
tblMRBData.Problem
FROM tblCheckStock INNER JOIN tblMRBData
ON tblCheckStock.MRBLogNo = tblMRBData.MRBLogNo
WHERE (((tblCheckStock.ChStPartID)=[Forms]![frmCheckStock]![cboPartID]))
ORDER BY tblCheckStock.MRBLogNo DESC;


isbjornen said:
Hello,

I'm having a query problem with linked tables in SQL Server 2005.
The query has two tables with the following SQL statement:

SELECT tblCheckStock.ChStPartID, tblCheckStock.MRBLogNo,
tblMRBData.Problem
FROM tblCheckStock INNER JOIN tblMRBData ON tblCheckStock.MRBLogNo =
tblMRBData.MRBLogNo
GROUP BY tblCheckStock.ChStPartID, tblCheckStock.MRBLogNo,
tblMRBData.Problem
HAVING (((tblCheckStock.ChStPartID)=[Forms]![frmCheckStock]![cboPartID]))
ORDER BY tblCheckStock.MRBLogNo DESC;

As is, I get "ODBC--call failed" error without any error number. If I
take
out "GROUP BY" the query works fine.

I'm running XP with msjet40.dll version 4.0.8618.0

I've tried KB303257, but I'm unable to duplicate the problem (i.e. I have
no
problem).

Any help is appreciated

Thanx!

Isbjornen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ODBC Call failed 3
update query ODBC--call failed 3
ODBC-call failed. 5
Update Query ODBC --- call failed 11
ODBC--Call failed. 4
ODBC --call failed 4
ODBC call failed 3
Crosstab query ODBC Fails - AYS2000 3

Top