I am completely new to Visual Basic. I am working with a MYSQL data base and I want to use VB in excel so I can work with more complex queries. For some reason, when I try to join tables in vb, I get an error message. Can somebody tell me what is wrong with my code.
strSql = "SELECT COUNT(*)FROM `order`" & _
"JOIN user ON user.id = order.destination_id" & _
"WHERE payment_status = 'pay';"
rs.Open strSql, oConn, adOpenDynamic, adLockPessimistic
res = rs.GetRows
rs.Close
Range("A1", "A6") = res(0, 0)