Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |