Home > Database > Mysql Tutorial > body text

mysql-執行階段錯誤'13' 型態不符合 ----VBA 連接MYSQL多表查詢

WBOY
Release: 2016-06-06 09:41:40
Original
1230 people have browsed it

mysqlvba

** 請教各位高手:

我在VBA中如下連接mysql單表查詢沒問題,有數據出來。
**

.CommandText = Array( _
"select " _
& "proc_hist_0.prod_pn , proc_hist_0.LOT_NO, proc_hist_0.proc_ID, proc_hist_0.IN_TIME, proc_hist_0.IN_QTY, proc_hist_0.OUT_TIME, proc_hist_0.OUT_QTY " _
& "FROM proc_hist proc_hist_0 " _
& "WHERE " _
& "proc_hist_0.co_code='" & mrpc & "' and proc_hist_0.PROD_PN='" & itnr & "' ")

<code>        **但是增加一個表左連接后就不行,報錯:執行階段錯誤'13' 型態不符合 。</code>
Copy after login

**
如下代碼,請幫忙看看錯在哪裡:

<code>         .CommandText = Array( _     "select " _    & "proc_hist_0.prod_pn , proc_hist_0.LOT_NO, proc_hist_0.proc_ID, proc_hist_0.IN_TIME, proc_hist_0.IN_QTY, proc_hist_0.OUT_TIME, proc_hist_0.OUT_QTY " _    & "FROM proc_hist proc_hist_0 " _    & "Left Join " _    & "proc_para proc_para_0 " _    & "On " _    & "proc_hist_0.co_code = proc_para_0.co_code " _    & "and " _    & "proc_hist_0.wip_id = proc_para_0.wip_id " _    & "and " _    & "proc_hist_0.proc_ref = proc_para_0.proc_ref " _    & "WHERE " _    & "proc_hist_0.co_code='" & mrpc & "'  and proc_hist_0.PROD_PN='" & itnr & "' ")</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!