請問底下這段程式碼,若反覆執行,它是會都使用同一記憶體位址,或者每次重新配置呢?若重新配置,那舊的佔用之空間是否有釋放呢?
Public Sub read_111_2()
Dim mySQL2 As String
mySQL2 = "SELECT 採購副檔.產品代號,產品基本.產品名稱,產品基本.單位,採購副檔.數量,採購副檔.單價,採購副檔.數量*採購副檔.單價 AS 小計,採購副檔.備註"
mySQL2 = mySQL2 & " FROM (採購副檔 INNER JOIN 採購主檔 ON 採購副檔.採購單號=採購主檔.採購單號) INNER JOIN 產品基本 ON 產品基本.產品代號=採購副檔.產品代號"
mySQL2 = mySQL2 & " WHERE 採購副檔.採購單號 = " & "'" & rs111_1("採購單號") & "'"
mySQL2 = mySQL2 & " ORDER BY 採購副檔.產品代號"
Set rs111_2 = New ADODB.Recordset
rs111_2.Open mySQL2, cn, adOpenStatic, adLockOptimistic, adCmdText
Set TDBGrid1.DataSource = rs111_2
End Sub