Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.mappath("/db/abc.mdb")
Set Conn2 = Server.Createobject("ADODB.Connection")
Conn2.Open = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.mappath("/db/abc.mdb")
sql = "Select * From product Order by ID"
Set RS =Server.Createobject("ADODB.Recordset")
RS.Open sql, Conn, 0, 3
sql = "Select * From buy Order by ID"
Set RS2 =Server.Createobject("ADODB.Recordset")
RS2.Open sql, Conn2, 0, 3
เขียนแบบด้านบนนี้ใช่ไหมครับ แต่เขียนแล้วไม่ work ครับ
Tag : - - - -
Date :
28 ม.ค. 2549 13:38:46
By :
Takeshi
View :
2372
Reply :
2
No. 1
Guest
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.mappath("/db/abc.mdb")
sql = "SELECT ฟิลด์ที่มาจาก Product , ฟิลด์ที่มาจาก By FROM product INNER JOIN by ON product.ฟิลด์ที่ใช้Link = by.ฟิลด์ที่ใช้Link"
Set RS =Server.Createobject("ADODB.Recordset")
RS2.Open sql, Conn, 0, 3
-----------ใช้ SELECT field FROM tablename INNER JOIN tablename ON field name = field name----------