Update MSSQL table with Uploaded MS Access DB

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Update MSSQL table with Uploaded MS Access DB

    I could use a little advice in this task. I have (potentially) dozens of users
    that will want to update their data on our server (MSSQL) by simply uploading
    their own exported data from their local systems. The first client I am trying
    to accomodate wants to send a MS Access DB.

    So I need to be able to do several things, read the NON datasourced Access DB,
    and INSERT and UPDATE the MSSQL version where appropriate. The data is
    membership listings, so there will be some new, some deleted and some simply
    edited. Would it be easier to replace the DB entirely with the new one? I
    assume so. If so, the question simply becomes;

    "How do I read an uploaded Access database with no named DATASOURCE attached
    to it and use its contents to replace a table in a MSSQL database?"

    bigbrain28 Guest

  2. Similar Questions and Discussions

    1. Copying complete table from one MSSQL database toanother
      I will soon have to move a complete table from one database to another (including the table structure and data in the table). Is there an easy way...
    2. table alias mssql problem
      I get this error: The column prefix 'F' does not match with a table name or alias name used in the query. with the query below Any ideas as...
    3. importing a text file into a MSSQL table
      I am trying to import a tab delimited text file into a MSSQL table and am not having much luck. the challenge is that the text file has 245 fields...
    4. mssql: update statement wrong or truncated
      Hi ! I have this upate statement which gets sent to MS SQL: update MsgOutgoing set SenderResource = NULL,RecipientAddress =...
    5. UPDATE MULTIPLE ROWS IN ONE TABLE OBTAINING SUMS FROM ANOTHER TABLE
      UPDATE MULTIPLE ROWS IN ONE TABLE OBTAINING SUMS FROM ANOTHER TABLE I need to update a table with distinct sums from another table. I will...
  3. #2

    Default Re: Update MSSQL table with Uploaded MS Access DB

    Use this but I assume 2 things :
    1) The SQL server is in the same server where the Access files are uploaded.
    2) You know the structure of the tables in the Access DB and the SQL DB.



    <CFQUERY NAME="Query Name" DATASOURCE="SQL DATASOURCE">
    DELETE FROM sql_table .......

    INSERT INTO sql_table (column1, column2 .....)
    SELECT AccessTable.column1, AccessTable.column2 .....
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'c:\UPLOAD_FOLDER\access.mdb';'';'', Access_Table) AS AccessTable

    /**** OR ****/

    UPDATE sql_table SET column1=AccessTable.column1
    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'c:\UPLOAD_FOLDER\access.mdb';'';'', Access_Table) AS AccessTable, sql_table
    WHERE .........

    </CFQUERY>

    Sojovi Guest

  4. #3

    Default Re: Update MSSQL table with Uploaded MS Access DB

    Well, thank you, firstly for your response, I will certainly give it a shot.
    Your first assumption, unfortunately is not true for me. Our SQL server and the
    webserver (where the uploaded Access DB goes) are not the same PC, they are
    however on the same network, so I should be able to path to the MDB. I do,
    however know/control the structures and should have no issues with that aspect.
    If the OPENROWSET call does the connection job, I believe I'll be in business.
    I will reply again once I have had the opportunity to test this code, thanks
    again!

    bigbrain28 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139