>VBA CODE
>--------------------------------------------------------------------------------
>
>Public conn As New ADODB.connection
>Set conn = New ADODB.connection
>
>conn.Open "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=F:\backup;Exclusive=no;"
>
>Set rsttemp = conn.OpenSchema("SELECT expichdf.*, expictxf.* FROM expichdf INNER JOIN expictxf ON expichdf.oh_no = expictxf.od_no WHERE oh_no='" & txtQuotationNumber.text & "'", adOpenDynamic)
>
>--------------------------------------------------------------------------------
>
>
>what's wrong at the Set rsttemp = conn.OpenSchema("SELECT expichdf.*, expictxf.* FROM expichdf INNER JOIN expictxf ON expichdf.oh_no = expictxf.od_no WHERE oh_no='" & txtQuotationNumber.text & "'", adOpenDynamic)
>this line the VBA return "DATA TYPE MISMATCH"
>
>PLEASE HELP ME !
>^_^
You use the OpenSchema method.
You need to use something like this to open a recordset:
rsttemp.open "SELECT expichdf.*, expictxf.* FROM expichdf INNER JOIN expictxf ON expichdf.oh_no = expictxf.od_no WHERE oh_no='" & txtQuotationNumber.text & "'", conn
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com