RE: UPDATE using params, again, deosn't work

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bin Song, MCP (anonymous_at_discussions.microsoft.com)
Date: 05/05/04


Date: Wed, 5 May 2004 06:16:03 -0700

Hi,
One question is stateEmail is a variable or textbox? if textbox, add .text afterit.
One simple thing is just replace all parameters with values, add the following in the beginning of the sub:
 After: Dim str As String
  str = "UPDATE ClientDetails SET ContactTitle='" & txtTitle.Text & "', ContactFirstName='" & Fname.Text & "', ContactLastName='" & Sname.Text & "', Tel='" & Tel.Text & "', HospContactPosition='" & txtPosition.Text & "', Fax='" & Fax.Text & "', Add1='" & Add1.Text & "', Add2='" & Add2.Text & "', Add3='" & Add3.Text & "', Add4='" & Add4.Text & "', PostCode='" & PostCode.Text & "', OrgName='" & OrgName.Text & "' WHERE Email='" & stateEmail & "'"
Response.Write(str)
Exit Sub
Then try execute the str value in Query Analyzer to check if the query has any problem.

Bin Song, MCP



Relevant Pages

  • RE: New to userforms - can you help with this code?
    ... If the user puts a "number" in a textbox, ... if number entered is found through column A of DATA worksheet, ... Dim iRow As Integer ... Exit Sub ...
    (microsoft.public.excel.programming)
  • Re: Challenge: selective parse of strings
    ... placed back into the textbox as the person types. ... Dim strAs String ... Dim str() As String, strTemp As String ...
    (microsoft.public.excel.programming)
  • RE: user form - how to set it up so it stores data when you press
    ... the textbox and view code. ... If KeyCode 13 Then Exit Sub ... copying it in but get this error "Procedure declaration does not match ... Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ...
    (microsoft.public.excel.misc)
  • RE: New to userforms - can you help with this code?
    ... if your textbox is named txtRef then it should be ... The textbox is named txtRef ... Dim iRow As Integer ... Exit Sub ...
    (microsoft.public.excel.programming)
  • RE: Date Format
    ... msgbox "Bad date" ... Does anyone know how to ensure that a textbox can only be input into as ... 'For i = 2 To Lastrow ...
    (microsoft.public.excel.programming)