#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB Macro

Hi EveryBody,

I am trying to fetch data from Oracle 8i using Microsoft
ODBC Driver using the following code, it's working fine in
my machine but not so with other machine(s) , I verified
the OS configuration it is same as my machine , and there
is no problem with ODBC Driver too. Here is my Error
Message

"General ODBC Error 1004" , at line ".Refresh
BackgroundQuery:=False"

Any help will be highly appreciated

Here is my Code:
****************
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER={Microsoft ODBC for
Oracle};UID=ewinnie;PWD=ewinnie;SERVER=ewinnie;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT s.SKU, s.SKU_DESC, d.DAT_PRICE,
s.UNITS_PER_CASE, s.UNIT_WT, s.CASES_PER_PALLET,
g.GRP_DESC" & Chr(13) & "" & Chr(10) & "FROM
EWINNIE.sku_dat d, EWINNIE.sku_groups g,
EWINNIE.sku_profile s" & Chr(13) & "" & Chr(10) & "WHERE
s.SKU = d.SKU AND g.SKU_G" _

, _
"RP_ID = s.SKU_GRP5 AND ((s.ACTIVE_FLAG='Y') AND
(d.COMPANY_NO=g.company_no And d.COMPANY_NO='1') AND
(d.DEAL_CD=upper('" & Order_Form & "')) AND
(d.ACTIVE_FLAG='Y') AND (g.SKU_GRP_TYPE='SKU_GROUP5'))" &
Chr(13) & "" & Chr(10) & "ORDER BY g.GRP_DESC," _

, " s.SKU")


.FieldNames = True
.RefreshStyle = xlInsertDeleteCells
.RowNumbers = False
.FillAdjacentFormulas = False
.RefreshOnFileOpen = False
.HasAutoFormat = True
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SavePassword = True
.SaveData = True
End With



  #2   Report Post  
Posted to microsoft.public.excel.programming
Den Den is offline
external usenet poster
 
Posts: 16
Default VB Macro

The other user or machine may not have rights to the Oracle database.

Dennis

"Gopal" wrote in message
...
Hi EveryBody,

I am trying to fetch data from Oracle 8i using Microsoft
ODBC Driver using the following code, it's working fine in
my machine but not so with other machine(s) , I verified
the OS configuration it is same as my machine , and there
is no problem with ODBC Driver too. Here is my Error
Message

"General ODBC Error 1004" , at line ".Refresh
BackgroundQuery:=False"

Any help will be highly appreciated

Here is my Code:
****************
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER={Microsoft ODBC for
Oracle};UID=ewinnie;PWD=ewinnie;SERVER=ewinnie;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT s.SKU, s.SKU_DESC, d.DAT_PRICE,
s.UNITS_PER_CASE, s.UNIT_WT, s.CASES_PER_PALLET,
g.GRP_DESC" & Chr(13) & "" & Chr(10) & "FROM
EWINNIE.sku_dat d, EWINNIE.sku_groups g,
EWINNIE.sku_profile s" & Chr(13) & "" & Chr(10) & "WHERE
s.SKU = d.SKU AND g.SKU_G" _

, _
"RP_ID = s.SKU_GRP5 AND ((s.ACTIVE_FLAG='Y') AND
(d.COMPANY_NO=g.company_no And d.COMPANY_NO='1') AND
(d.DEAL_CD=upper('" & Order_Form & "')) AND
(d.ACTIVE_FLAG='Y') AND (g.SKU_GRP_TYPE='SKU_GROUP5'))" &
Chr(13) & "" & Chr(10) & "ORDER BY g.GRP_DESC," _

, " s.SKU")


.FieldNames = True
.RefreshStyle = xlInsertDeleteCells
.RowNumbers = False
.FillAdjacentFormulas = False
.RefreshOnFileOpen = False
.HasAutoFormat = True
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SavePassword = True
.SaveData = True
End With





  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default VB Macro

Thank you Dennis for your response, but I am able to
connect to this database using sqlplus from the other
machine , and hence I assume they have rights to access
this database.

Any other idea ??

Thanks
Gopal

-----Original Message-----
The other user or machine may not have rights to the

Oracle database.

Dennis

"Gopal" wrote in

message
...
Hi EveryBody,

I am trying to fetch data from Oracle 8i using Microsoft
ODBC Driver using the following code, it's working fine

in
my machine but not so with other machine(s) , I verified
the OS configuration it is same as my machine , and

there
is no problem with ODBC Driver too. Here is my Error
Message

"General ODBC Error 1004" , at line ".Refresh
BackgroundQuery:=False"

Any help will be highly appreciated

Here is my Code:
****************
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER={Microsoft ODBC for
Oracle};UID=ewinnie;PWD=ewinnie;SERVER=ewinnie;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT s.SKU, s.SKU_DESC, d.DAT_PRICE,
s.UNITS_PER_CASE, s.UNIT_WT, s.CASES_PER_PALLET,
g.GRP_DESC" & Chr(13) & "" & Chr(10) & "FROM
EWINNIE.sku_dat d, EWINNIE.sku_groups g,
EWINNIE.sku_profile s" & Chr(13) & "" & Chr(10) & "WHERE
s.SKU = d.SKU AND g.SKU_G" _

, _
"RP_ID = s.SKU_GRP5 AND ((s.ACTIVE_FLAG='Y') AND
(d.COMPANY_NO=g.company_no And d.COMPANY_NO='1') AND
(d.DEAL_CD=upper('" & Order_Form & "')) AND
(d.ACTIVE_FLAG='Y') AND (g.SKU_GRP_TYPE='SKU_GROUP5'))"

&
Chr(13) & "" & Chr(10) & "ORDER BY g.GRP_DESC," _

, " s.SKU")


.FieldNames = True
.RefreshStyle = xlInsertDeleteCells
.RowNumbers = False
.FillAdjacentFormulas = False
.RefreshOnFileOpen = False
.HasAutoFormat = True
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SavePassword = True
.SaveData = True
End With





.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"