[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Excel ODBC to Access

Asked by neelyjer in Microsoft Excel Spreadsheet Software, Visual Basic Programming, Access Coding/Macros

Hey Experts,

I've been beating my head with this one...

I have the following ODBC connection from Excel to Access.  It was working fine, but I must have made a typo somewhere and I can't find it.  i'm getting a 'type mismatch' on the following code.  Any assistance is greatly appreciated.

Thanks Experts!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
    With Sheets("Base_Results").QueryTables.Add(Connection:=Array(Array( _
        "ODBC;DSN=MS Access Database;DBQ=C:\SIMControl\TestDB.mdb;DefaultDir=C:\SIMControl;DriverId=25;FIL=MS Access;MaxBufferSize=4096;PageT" _
        ), Array("imeout=5;")), Destination:=Range("A1"))
        .CommandText = Array( _
        "SELECT SPDH_BASE_RESULTS.`CASE #`, SPDH_BASE_RESULTS.`HDR-MSG-SUB`, SPDH_BASE_RESULTS.`HDR-DEV-TYP`, SPDH_BASE_RESULTS.`HDR-XMIT-NUM`, SPDH_BASE_RESULTS.`HDR-TERM-ID`, SPDH_BASE_RESULTS.`HDR-CURR-DATE" _
        , _
        "`, SPDH_BASE_RESULTS.`HDR-CURR-TIM`, SPDH_BASE_RESULTS.`HDR-EMP-ID`, SPDH_BASE_RESULTS.`HDR-TRAN-CDE`, SPDH_BASE_RESULTS.`HDR-RESP-CDE`, SPDH_BASE_RESULTS.FID_B_VAL, SPDH_BASE_RESULTS.FID_C_VAL, SPDH_" _
        , _
        "BASE_RESULTS.FID_D_VAL, SPDH_BASE_RESULTS.FID_F_VAL, SPDH_BASE_RESULTS.FID_K_VAL, SPDH_BASE_RESULTS.FID_J_VAL, SPDH_BASE_RESULTS.FID_R_VAL, SPDH_BASE_RESULTS.FID_S_VAL, SPDH_BASE_RESULTS.FID_U_VAL, SPDH_BASE_RESULTS.FID_LA_VAL, SPDH_BASE_RESULTS." _
        , _
        "FID_LB_VAL, SPDH_BASE_RESULTS.FID_LE_VAL, SPDH_BASE_RESULTS.FID_Y_VAL, SPDH_BASE_RESULTS.FID_Z_VAL, SPDH_BASE_RESULTS.FID_LQ_VAL, SPDH_BASE_RESULTS.FID_6D_VAL, SPDH_BASE_RESULTS.FID_6E_VAL, SPDH_BASE_" _
        , _
        "RESULTS.FID_6F_VAL, SPDH_BASE_RESULTS.FID_6G_VAL, SPDH_BASE_RESULTS.FID_6T_VAL, SPDH_BASE_RESULTS.FID_6_LE_VAL, SPDH_BASE_RESULTS.FID_6_LF_VAL, SPDH_BASE_RESULTS.FID_6_LH_VAL, SPDH_BASE_RESULTS.FID_6_LI_VAL, SPDH_BASE_RESULTS.FID_6_LJ_VAL, SPDH_BASE_RESULTS.FID_LV_VAL, SPD" _
        , _
        "H_BASE_RESULTS.FID_LW_VAL, SPDH_BASE_RESULTS.FID_LF_VAL, SPDH_BASE_RESULTS.FID_LI_VAL, SPDH_BASE_RESULTS.MODULE_REGRESSION, SPDH_BASE_RESULTS.SPDH_REGRESSION, SPDH_BASE_RESULTS.SWITCH" & Chr(13) & "" & Chr(10) & "FROM `C:\SIMCon" _
        , _
        "trol\TestDB`.SPDH_BASE_RESULTS SPDH_BASE_RESULTS" & Chr(13) & "" & Chr(10) & "FROM `C:\SIMControl\TestDB`.SPDH_BASE_RESULTS SPDH_BASE_RESULTS" _
        )
[+][-]11/05/09 11:53 AM, ID: 25753230Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 08:42 PM, ID: 25756649Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 06:04 AM, ID: 25759143Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625