我一共開了大約70個以上的欄位,不知是否會影響?如果會,是否有別的方法可代替?不必把欄位改變.
Private Sub TextToData
'將表格資料寫入資料庫
rs!ad_area = Trim(cmbArea.Text)
rs!ad_no = Trim(txtNo.Text)
rs!ad_name = Trim(txtName.Text)
....
........
End Sub
Private Sub cmdEdit_Click()
'更新
Call TextToData
rs.Update
End Sub
Private Sub Form_Load()
'我使用了兩種方式開啟資料庫
Adodc1.ConnectionString = "DSN=ODBCComm"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
SQL = "Select * From communalize"
Adodc1.RecordSource = SQL
Adodc1.Refresh
conn.Open "DSN=ODBCComm"
rs.CursorLocation = adUseClient
SQL = "select * from communalize"
rs.Open SQL, conn, adOpenKeyset, adLockPessimistic
End Sub