以下是我在程式中去連結 Access file (*.mdb) :
situation 1:)
dim cn as adodb.connection
dim rs as adodb.recordset
set cn=new adodb.connection
set rs=new adodb.recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & ConnStr
rs.CursorLocation = adUseClient
rs.open "select * from CUSTOMER", cn, adOpenDynamic , adLockOptimistic
for i=0 to 2
if text1(i) <> "" then
rs!field(i)=text1(i) ===> 此時就出錯了,
end if
next
rs.update
......
如果 rs.CursorLocation 設為adUseClient就不會
======================================================
situation 2:)
dim cn as adodb.connection
dim rs as adodb.recordset
set cn=new adodb.connection
set rs=new adodb.recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & ConnStr
rs.CursorLocation = adUseserver
rs.open "select * from CUSTOMER", cn, adOpenDynamic , adLockOptimistic
pos=rs.bookmark
rs.find "custid=12"
rs.bookmark=pos
如果我使用bookmark時就會有問題但是rs.CursorLocation 設為adUseclient就不會
但是我有需求要同時使用上述兩情形時我該如何解決?
請各位大內高手幫忙小弟解一下, 謝謝!