title: Second QueryDefs.SQL doesn't work
body: <p>I have code in Access VBA, that's fill query template with SQL and execute it. I have to querydefs. First is working fine, but with second when I assign SQL string I got error 3305.</p>
  
  <p>Both of inserted tables are on Oracle DB and I have linked tables to it.</p>
  
  <p>code</p>
  
  <pre><code>Sub prc()
  Dim pSQLStr      As String        
  Dim pQuery       As QueryDef   
  Dim pBaza        As Database  
  
  Set pBaza = CurrentDb
  Set pQuery = pBaza.QueryDefs("qryInsertTemplate")
  
  pSQLStr = ""
  pSQLStr = pSQLStr &amp; "INSERT INTO tbl1 ("
  pSQLStr = pSQLStr &amp; "ID, POS)"
  pSQLStr = pSQLStr &amp; "SELECT xlsx.ID, xlsx.pos"    
  pSQLStr = pSQLStr &amp; " FROM xlsx;"
  
  With pQuery
      .SQL = pSQLStr
      .ReturnsRecords = False
      .Execute
  End With
  
  Set pQuery = pBaza.QueryDefs("qryInsertTemplate")
  
  pSQLStr = ""
  pSQLStr = pSQLStr &amp; "INSERT INTO tbl2 ("
  pSQLStr = pSQLStr &amp; "ID, POS)"
  pSQLStr = pSQLStr &amp; "SELECT xlsx.ID, xlsx.pos"    
  pSQLStr = pSQLStr &amp; " FROM xlsx;"
  
  With pQuery
      .SQL = pSQLStr 'here I got error 3305
      .ReturnsRecords = False
      .Execute
  End With
  
  End Sub
  </code></pre>