我想在VB6中向數據庫中插入一些信息,但運行時錯誤爲'91'。 我的代碼:將數據添加到記錄集時的運行時錯誤'91'
Private sub btn_click()
Fname = txtFname.text
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("Fname") = Fname
Adodc1.Recordset.Update
End sub
的debuger顯示了錯誤:Adodc.Recordset.AddNew
我編輯了您的文章,使其更具可讀性。我做出的一個判斷是將Adodc1.Recordset.Fields(「Fname」)= Fname'寫成一行,而不是兩行。我認爲這是你的原始代碼,在複製粘貼錯誤拆分行之前,但請驗證這一點。 – MicroVirus