Results 1 to 2 of 2

Thread: Updating Record

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    Updating Record

    is this update statement correct? I'm used to writing UPDATE statements using the SET command.

    Code:
    Dim strConnection As OleDbConnection = New OleDbConnection("Provider=MSDAORA;Password=password;User ID=testuser;Data Source=WEBDDEVL") 
                Dim sqlCmd As String = "Update PBSS.PBSS_BID(Bid_ID, Bid_Type_Code, Buyer_Name, Post_To_Internet, Display_Start_Date, Update_Date, Update_ID) Values(?,?,?,?,?,?,?) Where bid_id = 11111" 
                'Dim objConnection As New OleDbConnection(strConnection) 
                Dim OleDbCmdObj As OleDbCommand = New OleDbCommand(sqlCmd, strConnection) 
    
                OleDbCmdObj.Parameters.Add("@Bid_Id", System.Data.OleDb.OleDbType.VarChar, 5).Value = txtBidId.Text 
                OleDbCmdObj.Parameters.Add("@Bid_Type_Code", System.Data.OleDb.OleDbType.Numeric, 2).Value = Bid_Type 
                OleDbCmdObj.Parameters.Add("@Buyer_Name", System.Data.OleDb.OleDbType.VarChar, 45).Value = txtBuyerName 
                OleDbCmdObj.Parameters.Add("@Post_to_Internet_ind", System.Data.OleDb.OleDbType.Numeric, 1).Value = Post_to_Int 
                OleDbCmdObj.Parameters.Add("@Display_Start_Date", System.Data.OleDb.OleDbType.Numeric, 1).Value = txtIntDisStartDate 
                OleDbCmdObj.Parameters.Add("@Update_Date", System.Data.OleDb.OleDbType.Numeric, 1).Value = Format(CDate(Now)) 
                OleDbCmdObj.Parameters.Add("@Update_Id", System.Data.OleDb.OleDbType.Numeric, 1).Value = userid 
    
                strConnection.Open() 
                OleDbCmdObj.ExecuteNonQuery() 
                strConnection.Close()

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Update [Database Name]
    Set
    [Field] = Value,
    [Field] = Value,
    ...
    [Field] = Value
    WHERE
    ...
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

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