Thom
Apr 26th, 2000, 06:11 AM
Help! I'm trying to dump a CSV textfile into my Access97 database, using ADO. when I get to the rs.AddNew line I get Error 3251! (The operation requested by the application is not supported by the provider) Here's the code:
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
connectString = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & App.Path & "\TestDB1.mdb;Jet OLEDB:database password=;Mode=Share Deny None"
' NOW OPEN DB
db.Open connectString
' NOW the Recordset
rs.Open "FirstTable", connectString, , , adCmdTable
' OPEN THE TEXT FILE
Open App.Path & TextFileName For Input As #1
'WRITE TEXT FILE TO VARIABLES
Do While Not EOF(1)
Input #1, sFirstField, sSecondField
' NOW LOAD THE DB
rs.AddNew ** HERE'S WHERE THE ERROR POPS UP!!
rs!FirstField = Trim(sFirstField)
rs!SecondField = Trim(sSecondField)
rs.Update
WHAT am I missing?? I'd appreciate any help! NOTE: the Access DB is a simple 1 table(FirstTable) DB, NOT password protected, if that helps any.
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
connectString = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & App.Path & "\TestDB1.mdb;Jet OLEDB:database password=;Mode=Share Deny None"
' NOW OPEN DB
db.Open connectString
' NOW the Recordset
rs.Open "FirstTable", connectString, , , adCmdTable
' OPEN THE TEXT FILE
Open App.Path & TextFileName For Input As #1
'WRITE TEXT FILE TO VARIABLES
Do While Not EOF(1)
Input #1, sFirstField, sSecondField
' NOW LOAD THE DB
rs.AddNew ** HERE'S WHERE THE ERROR POPS UP!!
rs!FirstField = Trim(sFirstField)
rs!SecondField = Trim(sSecondField)
rs.Update
WHAT am I missing?? I'd appreciate any help! NOTE: the Access DB is a simple 1 table(FirstTable) DB, NOT password protected, if that helps any.