PDA

Click to See Complete Forum and Search --> : Please Help!


Coder7
Apr 4th, 2000, 04:08 PM
Hi,

I have just started off with ADO, Database programming and I am already facing a problem I cant seem to solve.

Here is the code I have written:


Dim db As New ADODB.Connection
db.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\Wwwroot\Tutorial\guestbook.mdb;"
Dim rec As New ADODB.Recordset
rec.Open "Guest", db
rec.AddNew


The problem is that the 'rec.AddNew' statement gives the following error.

"The operation requested by the application is not supported by the provider"

ASP scripts that Insert data to a database dont work either.
But reading from a database works just fine.

[ Please help me solve this problem.I have spent about 3 days breaking my head over it. :-( ]

Thanx. :-)

Abid

Stevie
Apr 4th, 2000, 08:16 PM
Try something along the lines of


Set rs = New adodb.Recordset

rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open "Guest", db, , , adCmdTable

rs.AddNew


I may be wrong but I think if you don't specify how to open the recordset it defaults to foward only, which does not allow updates.