I have several questions:
1) Why do I generate an error when attempting to add a record using VB6 OpenRecordset realtime code -- when at the same time -- I am viewing the same Table in Access (as Administrator)
2) Will adding a Record using SQL INSERT INTO instead of OpenRecordset stop this error,
and if so, why?
3) The fastest (or best) way to add a record using DAO and why
================================
==========================Code:OpenRecordset method: Set rs = DaoDb.OpenRecordset(strTBLName) With rs .Index = "PrimaryKey" .Seek "=", dtmHistDateTime If .NoMatch Then .AddNew !fldOne = dtmTime !fldTwo = sngData .Update End If .Close End With
Code:SQL Param INSERT INTO method strParam = "PARAMETERS [pOne] DATETIME, [pTwo] SINGLE; " strSQL = strParam strSQL = strSQL & "INSERT INTO " & strTBLName strSQL = strSQL & " (fldOne, fldTwo)" strSQL = strSQL & " VALUES (pOne, pTwo);"




Reply With Quote