If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Macro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-18-04, 04:28
Jay9376 Jay9376 is offline
Registered User
 
Join Date: Mar 2004
Location: England
Posts: 4
Cool Macro

I have a spreadsheet written in Excel 98. It extracts data using a
Macro and query from Dbase table using DBase odbc driver.

This works fine.

When I try running this on another pc, I get the following error
message;

"Run time Error 1004. General ODBC Error"

I had a look on the ODBC log file, and the following was reported

Driver's SQLSetConnectAttr failed (0)

When I click on the deub line, the error is reported at the following;

Selection.QueryTable.Refresh BackgroundQuery:=False

Any ideas on how we may resolve? I have ticked ODBC add-in Excel.

I have even tried changing the False to True.

Many thanks for your help people. I look forward to your reply.

Regards

Jay
Reply With Quote
  #2 (permalink)  
Old 03-18-04, 07:31
Philem Philem is offline
Registered User
 
Join Date: Nov 2003
Posts: 9
Hullo. You may want to try checking the OBDC settings of the failing computer. Make sure that it has the correct setup for DBase, mirroring the system that works.

HTH

J
Reply With Quote
  #3 (permalink)  
Old 03-18-04, 07:54
Jay9376 Jay9376 is offline
Registered User
 
Join Date: Mar 2004
Location: England
Posts: 4
macro

Hi!

thanks for getting back to me.

I have checked the driver version (using dbase and the working pc version is the same as the one that does not work...

Any more kind assistance would greatly be appreciated!!

Jay
Reply With Quote
  #4 (permalink)  
Old 03-18-04, 09:39
Jay9376 Jay9376 is offline
Registered User
 
Join Date: Mar 2004
Location: England
Posts: 4
The actual problem paragraph is;

Sheets("PROVISIONAL").Select
Range("C6").Select
****Selection.QueryTable.Refresh BackgroundQuery:=True
Sheets("CURRENT WEEK").Select
Range("A2").Select
End Sub


where **** is the problem line..

hope this can help someone point me in thr right direction!!

many thanks in advance.

Jay
Reply With Quote
  #5 (permalink)  
Old 03-18-04, 17:15
Smitty Smitty is offline
Registered User
 
Join Date: Dec 2003
Location: San Diego, CA
Posts: 153
Welcome to the Board!

Have you tried setting up the Data-->Get External Data-->New Database Query sequence and connecting to the Database from the other PC?

Without the full sequence code, there is no query to refresh. Once you set up the new query, everything should work fine.

Hope that helps,

Smitty
Reply With Quote
  #6 (permalink)  
Old 03-19-04, 03:48
Jay9376 Jay9376 is offline
Registered User
 
Join Date: Mar 2004
Location: England
Posts: 4
Hi there!

Thanks for getting back to me.

I have tried your suggestion and the following error message comes up;

[Microsot][ODBC dBase driver] Index not found.

The data tables I am used are Dbase with ntx indexes. I have checked my version of the Dbase driver (odbcjt32.dll) and it is the same as the pc that is working.

Is there anything else that I am missing?

Many thanks in advance!

Jay
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On