excel vba general odbc error 1004 Duff Tennessee

Address 221 Church Rd, la Follette, TN 37766
Phone (423) 562-8008
Website Link http://www.computercarerepairs.com

excel vba general odbc error 1004 Duff, Tennessee

Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Make a suggestion Dev centers Windows Office Visual Studio Microsoft Azure More... write Expand|Select|Wrap|Line Numbers msgbox(.connection) before you refresh the querytable, this will show you the connection path, so you can check it. On the code above: I think it is less demanding, not that a few characters are hard to deal with, but it doesn't have to read the previous value every time

I have an ODBC with read-only privileges and I recorded part of the code from the macro. This is the error we have got: Run-Time Error 1004, General ODBC error. Sub Refresh_all() Application.ScreenUpdating = False Application.Goto Reference:="querycell" Range("A2").Select Selection.QueryTable.Refresh BackgroundQuery:=False Dim pt As PivotTable Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.RefreshTable Next pt I would remove some unecessary line in the command until you get it to work.

Here is a summary of the code: cn = "ODBC;Driver={SQL Server Native Client 10.0};Server=serverName;Database=dbName;Trusted_Connection=yes;" sql = "select top 10 * from tableName" Dim S As Worksheet Set S = ActiveWorkbook.Sheets("Medical") With Also, i tried running the code post removing DefaultDir and Driver Id as well. To use the 32 bit manager, you must specifically run %SystemRoot%\syswow64\odbcad32.exe. The problem is the way I'm putting the date variable into the array.

Here are things that I think are un-needed 1) DefaultDir= 2) DriverId=281 Also make sure all your variables are references the correct path names like newfile2. "CLR" wrote: > Hi Joel........ Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. Vaya con Dios, Chuck, CABGx3 "Joel" wrote: > It would help to know which line of code is failing. now, what i've seen, is that you have written "ODBC;DSN=ADW;UID=CurUser;APP=Microsoft Office 2003;WSID=CP040;DATABASE=DataWarehouse;Trusted_Con nection=Yes" _ , Destination:=Range("A1")) check how 'Trusted_con nection=Yes' has a space between both n's, I'd say you dont have

Thanks Matt share|improve this answer answered Dec 1 '14 at 10:26 Matthew Hopkins 105 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up Resources Join | Indeed Jobs | Advertise Copyright © 1998-2016 ENGINEERING.com, Inc. To use the 32 bit manager, you must specifically run %SystemRoot%\syswow64\odbcad32.exe. Are independent variables really independent?

After the database connection is made, the SQL query is validated. I always edit recorded macros eliminating the unecessary items and replace SELECTION with absolute cell references. "CLR" wrote: > Hi Joel......... > Well, you saved the day, or week, or several If you're having a computer problem, ask on our forum for advice. Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free!

I've tried both the 32bit (oraclient11g_home1_32) and the 64bit (oraclient11g_home1) however with no luck. ODBC error in Excel macro, on one particular PC P: 13 elecooley Baically, myself and the person I sit next to use a shortcut to an Excel file. The error you are getting indicates an error with the query connection. You can obtain the completed connection string by examining the value of the Connection property.

If anything is unclear or if there is anything I can do for you, please feel free to let me know. ronaksinghwadhwa, Jul 10, 2013 #8 Advertisements Show Ignored Content Want to reply to this thread or ask your own question? The Excel file has multiple macros. Jan 31 '08 #3 reply Expert 100+ P: 1,295 kadghar I think the error comes from the Connection.

floppybootstomp posted Oct 14, 2016 at 3:53 PM Toe-tale Taffycat posted Oct 14, 2016 at 11:04 AM WCG Stats Friday 14 October 2016 WCG Stats posted Oct 14, 2016 at 8:00 Is it possible to have a planet unsuitable for agriculture? need book id, written before 1996, it's about a teleport company that sends students learning to become colonists to another world What is a type system? How can I get it to keep from being changed?

then put these changes in the > > non-working PC. > > > > Here are things that I think are un-needed > > > > 1) DefaultDir= > > 2) It might be useful to know which one is the "exception". Please take your time to try the suggestions and let me know the results at your earliest convenience. I am stumped.

I'm getting a Run-time error '1004': General ODBC Error. Close this window and log in. Taffycat posted Oct 15, 2016 at 9:19 AM WCG Stats Saturday 15 October 2016 WCG Stats posted Oct 15, 2016 at 8:00 AM Review round up - 14 October 2016 Becky RE: Run-time error '1004' General ODBC Error SkipVought (Programmer) 9 Sep 10 13:02 oh and one other thing:What VERSION of Excel?

Any other suggestions? I am using a dsn that is set up already and it works, but should I try setting up a new one for this test. Does chilli get milder with cooking? share|improve this answer answered Apr 23 '13 at 1:44 lance 26115 add a comment| up vote 0 down vote Change your property .Refresh BackgroundQuery:=False to be .Refresh.

All rights reserved. Removing elements from an array that are in another array Does chilli get milder with cooking?