Click to See Complete Forum and Search --> : adLockOptimistic....
weijian
May 8th, 2001, 12:30 AM
I understand that we need to make the connection to the database adLockOptmistic before we can modify any data in the database. If we were not using pure SQL execution, the code would be:
Set rstCustomers = New Recordset
rstCustomers.Open strSQL, conDatabase, _
adOpenDynamic, adLockOptimistic
But if we use the pure SQL string (without opening a recordset), what would be the code? Where do we put the adLockOptmistic?
monte96
May 8th, 2001, 01:08 PM
I assume your talking about an Insert statement.
You don't put the adLockOptimistic anywhere. That is for the recordset. You will simply use the SQL string as a parameter for the connection object's execute method:
conn.execute "INSERT into table (field1, field2, field3) values 7, 8 9"
That's an over-simplified version.. you will most likely build your SQL string first and pass the string variable to the execute method, but it gives you the idea of the syntax..
weijian
May 8th, 2001, 09:48 PM
Problem is if I do not put anything it would come up with an error "Query must be updatable". I thought that was why I couldn't use INSERT INTO of UPDATE SQL commands.
monte96
May 8th, 2001, 10:24 PM
Make sure your database is in a directory that can be *written* to by IIS and I'm assuming you already checked the database file to make sure it is not read only.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.