Results 1 to 2 of 2

Thread: Insert New Record's and VB Pukes

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Moose Jaw
    Posts
    4

    Angry Newbie Needs Help with Error.

    I click the button and Boom VB pops up with "Object or provider is not capable of performing this operation"

    Please Help :-)

    Twitch


    Private Sub cmdInsert_Click()
    Dim RSsql As New ADODB.Recordset
    Dim connsql As ADODB.Connection

    Set connsql = New ADODB.Connection

    connsql.ConnectionTimeout = 25
    connsql.Provider = "sqloledb"
    connsql.Properties("Data Source").Value = "athome"
    connsql.Properties("Initial Catalog").Value = "Logging"
    connsql.Properties("User ID").Value = "graysonco"
    connsql.Properties("Password").Value = "grayson"

    connsql.Open

    connsql.BeginTrans

    RSsql.Open "SELECT * FROM SERVERADMINSERVERS", connsql

    'when I debug it highlights RSsql.Addnew


    RSsql.AddNew
    RSsql.Fields("Server") = txtServer.Text
    RSsql.Fields("IPAddress") = txtIP.Text
    RSsql.Fields("HubPort") = txtHub.Text
    RSsql.Fields("CPU") = txtCPU.Text
    RSsql.Fields("HardDiskSize") = txtHDD.Text
    RSsql.Fields("OS") = txtOS.Text
    RSsql.Update

    connsql.CommitTrans

    RSsql.Close
    Set RSsql = Nothing

    connsql.Close

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Actually, VB is correct. Recordsets are by default adOpenForwardOnly and are read only.

    Try this:
    Code:
    RSsql.Open "SELECT * FROM SERVERADMINSERVERS", connsql, adOpenKeyset
    and don't forget to set your connection to nothing as well..
    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