Results 1 to 4 of 4

Thread: adLockOptimistic....

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    KL Malaysia
    Posts
    64

    adLockOptimistic....

    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?

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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:

    Code:
    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..
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    KL Malaysia
    Posts
    64

    but,.,.

    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.

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width