Results 1 to 2 of 2

Thread: query error

  1. #1
    Join Date
    Dec 2012
    Posts
    2

    Unanswered: query error

    Hello I'm new to this forum and programming in general. I am receiving the error (picture also attached) "Run-time error '-2147217900 (80040e14)': [ProvideX][ODBC Driver][Expected lexical element not found:<identifier>

    In the long run I am looking to add three tables but figured I would start with two and then add the third. Using a WHERE it works fine but INNER JOIN and JOIN I receive this error. Any help is much appreciated thanks.
    JO

    Code:
     
     Dim cnt As New ADODB.Connection
        Dim rst As New ADODB.Recordset
        Dim str, StrConn As String
        Dim x, LstCnt As Long
        Set cnt = New ADODB.Connection
        Set rst = New ADODB.Recordset
        
        'connection string
        StrConn = "DRIVER={ProvideX ODBC Driver};Description=Local Maxwell Files;IniFile=C:\Mxw\NGS_Tables.ini;LogFile=\PVXODB32.LOG;Mode=Read;DirtyReads=1;BurstMode=1;SERVER=NotTheServer"
          With cnt
            .ConnectionString = StrConn
            .Provider = "MSDASQL"
            .Open StrConn
          End With
    
     str = "SELECT CWIPH.CUST_NO, CCSMS.CUST_NO " _
        & "FROM (CWIPH INNER JOIN CCSMS ON CWIPH.CUST_NO = CCSMS.CUST_NO) "
    
    'This is where I am receiving the error.
    rst.Open str, cnt
    Attached Thumbnails Attached Thumbnails Capture.PNG  

  2. #2
    Join Date
    Dec 2012
    Posts
    2
    I needed up using the code below for now. But if anyone has the answer to my question above please post thanks!

    Code:
    str = "SELECT CWIPH.JOB_NO, CCSMS.CUST_NAME, CSPCL.CUS_SITE_ADDR_1 " _
        & "FROM CWIPH, CCSMS, CSPCL " _
        & "WHERE (CWIPH.CUST_NO = CCSMS.CUST_NO) " _
        & "AND (CSPCL.CUST_NO = CCSMS.CUST_NO) "

Posting Permissions

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