Built in Function to Populate an access table from an Oracle Table through VB 6.0

Dear all,
Is there any built in function in VB 6.0 to populate an access table directly from an oracle table or SQL Server(Assume Both has the same columns & data type).
(Just like the DoCmd command which can be used to populate an excel sheet directly from an access table).
Please help.
Regards
Sibby.

Sibby,
There is no "built-in" code in VB that I am aware of. However, you could use this code which I wrote for SQL Server. For Oracle, you would have to change to the appropriate table to get all the table names. You can filter by table name to get just your tables like I did below (My_).
'* Now select all the files and add to access.
sSQL = "SELECT name, id FROM sysobjects WHERE xtype = 'U' AND SUBSTRING(name, 1, 3) = 'My_' ORDER BY name"
Set rstTemp = OpenRdSetView(sSQL:=sSQL, adoConnection:=adoConnection)
On Error GoTo TableExistError
'* Loop through all my database tables and copy to the Access database.
With rstTemp
Do While Not .EOF
'* Copy this to the Access backup database.
sTableName = .Fields("Name").Value
'* Select all records from the SQL Server table and copy to the local Access database.
sSQL = "SELECT * INTO " & sTableName & " FROM "
sSQL = sSQL & "[odbc;dsn=" & sDSN & ";UID=" & sUID & ";pwd=" & spwd & ";]." & sTableName
adoBackupConnection.Execute sSQL, , adExecuteNoRecords
'* Go to next table.
.MoveNext
Loop
End With

Similar Messages

  • Hi, Bapi or function module to update RBCO table from an internal table.

    I have a requirement to  update RBCO table from an internal table.  is there any Bapi or function module  or any other method other than update, modify statements.
    Moderator message: Welcome to SCN!
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Jul 12, 2011 12:28 PM

    I don't know if any FM exists for your requirement. But you may like to copy it into a custom table and modify it according to your enterprise needs.

  • Export data from MS sql server table to an oracle table

    I need to move data from a sql server table to an oracle table and when ever the sql server table is updated it needs to automatically update the oracle table. Is there procedure to do this or do I migrate the data once and set up a trigger on the sql server table to update the oracle table? If the trigger is the answer how do I do that?

    You might want to check out Oracle's heterogeneous services functionality if you haven't done so already. Here are a few links:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/toc.htm
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/majfeat.htm#sthref74
    Also, consulting the Oracle streams manual may be helpful -- particularly Chapter 5.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14228/toc.htm
    Perhaps someone who is more familiar with SQL Server could provide a more helpful answer.

  • How to create a table from an existing table with new column

    Hi !
    Please help me.
    I want to create a table from an existing table with data and add two new column to the new table.
    What will be the syntax?

    craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
    new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
    if you want to have VARCHAR2 instead of CHAR for example:
    SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
    Table created.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            CHAR(8)
    SQL> alter table new_dept modify (new_col varchar2(8));
    Table altered.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            VARCHAR2(8)Rgds.
    Didn't see michael's post - it reflects the fix for this problem using CAST.
    Message was edited by:
    dnikiforov

  • How to import a table from another oracle database ?

    Hi all ,
    i could like to use pl/sql to import one table from another oracle database server ?
    is it possible to do this ?
    A server B server
    table: test <------------------------> table : newtest
    the tns profile already configurated . the connection is ready .
    thanks a lot !
    Best Regards,
    Carlos

    if i don't have TEST table on server B whether COPY command will create this table on server B with the same structure ? If you specify CREATE as a clause the table will be created:
    SQL> help copy
    COPY
    COPY copies data from a query to a table in a local or remote
    database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    COPY {FROM database | TO database | FROM database TO database}
                APPENDCREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    where database has the following syntax:
         username[password]@connect_identifier

  • How to export data from a Oracle table to a delimited file?

    I know how to load delimited file into a table, but how to export
    data from a Oracle table to a delimited file?
    Thanks in advance.

    Try looking at this link, it's long but there's three different solutions discussed in it. If you look at Barbara Boehmer's
    solution in her posts in the link below you'll see that she's addressed your concerns with spool files.
    Re: utl_smtp and triggers

  • How do you join two tables from different Oracle schemas using a subquery

    I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
    The query is as follows:
    sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
    + "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
    + "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
    + "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
    The format of the query is copied from a SQL programming manual.
    I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
    Edited by: user11338343 on Oct 19, 2009 6:55 AM

    I believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
    If you want to do a straight join without a subquery you could do the following
    SELECT  DD_12809.PDTABLE_12_1.LINE_ID
    ,       FAB.MAT_DESCRIPTION
    FROM    DD_12809.PDTABLE_12_1
    JOIN    RA_12809.PDTABLE_201    AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS  HTH!

  • OBIEE 11g - Combine data from two Oracle tables

    Good day!
    I tried to combine data from two Oracle tables as fact data, but it doesn't work.
    My steps: I created SCOTT.EMP2 table from SCOTT.EMP table, update EMPNO and ENAME values of EMP2 table to distinguish data of my tables. Then I imported physical tables DEPT, EMP and EMP2 to BIEE 11g, created joins DEPT-EMP and DEPT-EMP2 in physical diagram. Then I dragged DEPT and EMP tables to BMM, and EMP2 table to EMP as second LTS. In Content tab for EMP and EMP2 I checked "This source should be combined with other sources at this level" checkboxes. Then I renamed logical tables EMP and DEPT to Employees and Departments and dragged them to Presentation area. In Answers I created Analysis with columns DNAME and ENAME.
    The problem is that data on results tab is only from one physical table EMP or EMP2 (depending on the order of sources EMP and EMP2 of LT Employees) and not from both.
    Can anybody help? Am I missed something?
    Al.

    Hi Al,
    I think you have to define the content of the LTS.
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_BusModSetup16.html
    You have to specify the content of the different fragments.
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_SetUpAggNav3.html#wp1005333
    Maybe you have to add an additional column 'Source' ('EMP1', 'EMP2')
    Good Luck,
    Daan Bakboord
    http://obibb.wordpress.com

  • Insert data into fact table from source database tables

    here i try to insert data into fact table from source database tables here is the query 
    ALTER procedure [dbo].[facttable]
    as
    insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
    select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
    from
    [PRODUCTION PLANNING 2].dbo.[Products],
    [PRODUCTION PLANNING 2].dbo.[Production Detail],
    [PRODUCTION PLANNING 2].dbo.[Material category],
    [PRODUCTION PLANNING 2].dbo.[Materials],
    [PRODUCTION PLANNING 2].dbo.[Equipment],
    [PRODUCTION PLANNING 2].dbo.[Working Centre] ,
    [PRODUCTION PLANNING 2].dbo.[Recipies]
    where
    Products.[Product ID] in (13, 14, 15, 16, 17) and
    [Production Detail].[Production ID] in (1, 2, 3) and
    [Materials].[Material ID] in (1, 2, 3, 4, 5) and
    [Equipment].[Equipment ID] in (1, 2, 3, 4) and
    [Working Centre].[Work Centre ID] in (1, 2, 3) and
    [Recipies].[Recipy ID] in (1, 2, 3) and
    [Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
    and when i execute query it shows me error 
    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
    ERD IS
    HOW TO SOLVE THIS PROBLEM?

    I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
    The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Create one tables from 2 different tables

    Hi,
    How I can create one table from 2 different tables. Source tables have data and I want to include it in new table.
    I try this:
    create table NEW_ONE
    select * from OLD_ONE
    union
    select * from OLD_ONE2;
    But it didn't work correctly :/

    I don't have any error. This syntax create table NEW_ONE, but this table have columns only from OLD_ONE table :/ There aren't any column from OLD_ONE2 :/ Any suggestions?
    I don't forget about "as" in my query, only in this post.
    Edited by: tutus on Sep 8, 2008 6:36 AM

  • Can we run an assignment on a qualified table from a main table?

    Can I run an assignment on a qualified table from a main table.
    For example: My main table Vendor and Qualified  Table is Company Qualified .
    Company Qualified - VendorNr (Non- Qualifier),Company(Qualifier,lookupFlat - Company)
    Company  - Name,Description (It has valid values in it already).
    How to add a default value into the Company Qualified table.
    When i add a assignment like
    If(is_null(Company Qualified [Record],default lookup value from Company)  ...it says invalid.
    Any help greatly appreciated  thanks

    This is not possible currently in MDM.  I've tried many times to find a good way to do this and so far have been unsuccessful.  I also have tried to have a workflow on the main table call an assignment in a lookup / qualified table, and that doesn't work either.  The biggest reason is because you have to select a table field when you create an assignment, and it doesn't give you the option to choose fields within a table.
    Hopefully they will address this in a future release.
    Edited by: Harrison Holland on Jun 3, 2008 2:33 PM

  • PLS-00327 when updating table from a remote table inside a PLSQL procedure

    Hi,
    Inside a PL/SQL procedure,I want to update a table from a remote table :
    begin
    UPDATE rachel1 set NEW_TEN_CODE =
    (SELECT NEW_TEN_CODE FROM rachel@REFI
    WHERE rachel1.OLD_TEN_CODE=rachel.OLD_TEN_CODE@REFI);
    end;
    I receive the error :
    PLS-00327: "RACHEL" is not in SQL scope here
    When I extract the update from the procedure and I run from SQL (without begin ... end), it works :
    SQL> UPDATE rachel1 set NEW_TEN_CODE =
    2 (SELECT NEW_TEN_CODE FROM rachel@REFI
    3 WHERE rachel1.OLD_TEN_CODE=rachel.OLD_TEN_CODE@REFI);
    So, why doesn't the update work inside the PL/SQL procedure ?
    What have I to do ?
    I need to run this command inside the procedure.
    Regards,
    Rachel

    Hi,
    Yes, the owner of the procedure have select on RACHEL@REFI.
    My oracle version is : 8.1.7.4.
    In fact, I've resolved the problem by doing :
    begin
    UPDATE rachel1 set NEW_TEN_CODE =
    (SELECT NEW_TEN_CODE FROM rachel@REFI
    WHERE rachel1.OLD_TEN_CODE=rachel.OLD_TEN_CODE);
    end;
    Regards,
    Rachel

  • Lgical table from two physical table

    Hi,
    I am trying to design a logical fact table from two physical table. One table has transaction data and another has accounting data. The requirement is, I need to merge the rows between these two tables, where were it matches. If the keys are not matching between these two table then also I need to bring those rows from both tables as separate rows. How can i do this? Also can i have a logical table as source for my fact table.

    You'll need outer joins in your physical layer and you can drag the columns from both physical tables to a single logical table and you will see in the BMM layer it will create the two logical table sources.

  • Updating database table from an internal table

    Hi All,
    I am updating a database table from an internal table.
    I am changing the non-key fields in that table.
    when I check sy-subrc = 4.
    Record already exists, because I am changing non-key fields of the
    database table.
    Is there any addition like to accept the duplicate keys with update.
    Alternatively, I have used Modify, It is adding new record,
    Again, I have search the old record and use Delete on the database table.
    Thanks & Regards,
    Kalyan Chandramouli
    SAP ABAP Consultant

    Hi,
    You are right, the field which I am trying to change is a part of primary key.
    Because, sy-subrc = 4. says,
    No line with specified primary key exits in the database table.
    I have a Z-tabel, with Kunnr Vkorg Matnr Bzirk Bztxt Split_percentage
    In this table primary key consists of KunnrVkorgMatnr+Bzirk.
    I am able to change the Split_percentage using UPDATE.
    Now, my client want to change Bzirk, Bztxt also in the table.
    How can I Go.
    Thanks & Regards,
    Kalyan Chandramouli
    SAP ABAP Consultant

  • Populate Final internal table from Dynamic internal table

    Hello,
    I have ti display data in ALV grid whose structure is fixed. I am dynamically selecting data iin an internal table.
    Now from this dynamic internal table, i need to populate my final internal table whose structurte is fixed.
    Please help.
    Rgds,
    Himanshu

    Hello Himanshu,
    When you say dynamic internal table there are two things one is the actual structure and other one is field table that holds information for all the fields used to create dynamic internal table.
    No if you want to move data from dynamic table to fixed internal table then you can try as follows:
    1.
    field-symbols <field_name> TYPE C.
    field-symbols <field_value> TYPE C.
    Now you either use
    LOOP AT fields_itab.
    ASSIGN fields_itab-fieldname to <field_name>.
    ASSIGN COMPONENT <field_name> OF STRUCTURE <structure_name> TO <field_value>
    Now you move value from <field_value> to required field in fixed internal table.
    i.e.
    itab-fieldname = <field_value>.
    Other way to do this:
    If you fields order is constant then you can also use index in assign component statement.
    do <no_of_fields> times.
        ASSIGN COMPONENT sy-index OF STRUCTURE <structure_name> TO <field_value>.
    rest is same as first method.
    Hope this help!
    I have given sudo code and you need to work on it little.
    Thanks,
    Augustin.

Maybe you are looking for

  • Windows 8 won't install on my dc110

    I'm struggling to install Windiws 8 on my DC110. When I run the installer it tells me I need to locate a missing media driver. I'm installing it off a bootable sd card I made using winusb. Has anybody else suffered thus problem?

  • User Accounts Disabled For No Apparent Reason

    We're having something where Entourage users are apparently handing off the incorrect user name and password when logging in to read email and thereby disabling their Apple user account on our mail/webmail OSX server. I don't know how to stop the acc

  • Poker odds

    Hi, i found some source code online for a holdem poker odds calculator. i had a look at the code, and tried to copy and compile it. It compiles, but doesn't give the answer i was expecting! bascially it's for a java appletts which you can see here: h

  • Change origin of canvas

    hey, i have a canvas that positions itself in the middle of the screen with two lines (x and y axis). the problem is that i want to be able to move the origin, which then draws the axis again. thanks Pedge // GCanvas.java import java.awt.*; import ja

  • BO XI3.1 sp3 server installation

    We are planning to upgrade BO XIR2 to BO XI 3.1 sp3 version. Approach: We will install BO XI 3.1 sp3 on the same server where BO XIR2 is currently installed in a new disk.After successful upgrade we will uninstall BO XIR2 version. Will there be any i