473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ODBC connection failed error 3146 (used to work)

This is a select statement that used to work. The sql db was upgraded from 7 to 2000, since it last worked, and that is the only change. the VB code is used in an Access 2000 app. Now I can run this script in Query Analyzer and it works, slow, but fine. But when it's run in Access it times out.

The culprit seems to be
WHERE (Clients.CCCID) Is Not Null
If I take this out it runs through the script, but it selects nothing, but this is the one statement that if removed allows it to not time out.

here's the select statement. Thanks in advance!


strSQLR = "select CCCID, cap from clients where CCCID not in " & _
"(SELECT Clients.CCCID AS CCCID FROM jobs right JOIN Clients ON jobs.ShopID=Clients.Cli " & _
" WHERE (Clients.CCCID) Is Not Null And jobs.Status='done' And jobs.[Month] = #" & CDate(txtMonth) & "# ) " & _
" and CCCID is Not Null and cap is Not Null"
Jul 11 '07 #1
1 1976
Before thinking about rewriting the SQL query, try extending the timeout on the database connection object / SQL command object. I think the default is 30 secs. Make it 180 secs & see what happens.

If this does the trick, then think about rewriting the SQL query.
Jul 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Vic Spainhower | last post by:
Hello, This is probably not the correct forum to post this problem but I posted it in the Access group but didn't get a reply and I'd like to move forward on this. I have setup an ODBC...
5
by: SerGioGio | last post by:
Hello, I am going nuts. I am trying to connect to my local ORACLE instance using ODBC. It used to work few weeks ago, but it fails now. Connection with: - SQL*plus: connection works! -...
13
by: Eric E | last post by:
Two questions regarding ODBC. 1) I am connecting to a MySQL database using the following code: Function LoginToMySQL(sUsername As String, sPW As String) As Boolean Dim dbMySQL As Database Dim...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
1
by: Doolittle | last post by:
Hi, I'm a relatively new VBA programmer but have been given the task of repairing a database that currently appears with "3146 ODBC--call failed." This happens when various criteria are input into...
2
by: Jimbo | last post by:
I have an access 97 database linked to sql server..I click update on a form and get an error message: Run-time error 3146 ODBC call failed The debugger points to this line: MyTable.Update
9
by: Greg Strong | last post by:
Hello All, What is the maximum length of an ODBC pass through query? Things work fine with the code except when I try to create a view which is pretty complex in Oracle. I'm using a DSN...
16
by: network-admin | last post by:
We have Problems with Access query on Oracle 10g Database with ODBC Connection. The Query_1 is such as select * from xtable where ycolumn <"S" Result = ODBC Faild...
1
by: Ramya Shree S | last post by:
Hi all, One of my application uses VB 3 and MS ACCESS as database. I am getting error 3146 ODBC connection failed when i try to retrieve the records. Please consider this as high priority issue and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.