INNER JOIN问题

时间:2014-10-22 06:38:36

标签: sql vb6

我试图在VB6上创建代码,但似乎发生了错误... 你能帮我掌握吗?

这是我的代码:

"SELECT guru.nip, guru.nama_guru, set_hr_kerja.bulan, set_jam_kerja.hari, set_hr_kerja.jlh_kerja, set_jam_kerja.jam_masuk " & _
"FROM (guru INNER JOIN set_hr_kerja ON guru.nip = set_hr_kerja.nip) INNER JOIN set_jam_kerja ON guru.nip = set_jam_kerja.nip " & _
"WHERE " & _
"nama_guru LIKE '%" & Kutip(TBox(Index).Text) & "%' OR " & _
"hari LIKE '%" & sHari & "%' " & _
"ORDER BY nama_guru")

错误说:" ODBC驱动程序不支持所请求的属性"当我按下时 调试按钮错误"当对象关闭时不允许操作"

我该怎么办?你能帮助我吗? 如果你能帮助我,我很高兴...... 感谢

1 个答案:

答案 0 :(得分:0)

您的陈述中有错误。 FROM之后的括号不正确,也不是真的需要。

"SELECT guru.nip, guru.nama_guru, set_hr_kerja.bulan, set_jam_kerja.hari, set_hr_kerja.jlh_kerja, set_jam_kerja.jam_masuk " & _
"FROM guru INNER JOIN set_hr_kerja ON guru.nip = set_hr_kerja.nip) INNER JOIN set_jam_kerja ON guru.nip = set_jam_kerja.nip " & _
"WHERE " & _
"nama_guru LIKE '%" & Kutip(TBox(Index).Text) & "%' OR " & _
"hari LIKE '%" & sHari & "%' " & _
"ORDER BY nama_guru"