Update and Add Procedure Problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having the same problem for both types of Procedures.
i have an Employee form and when i try to add/update the address, for
instance, and there is a space such as '12345 doesntwork Way' I get
runtime error - Incorrect syntax error near 'doesntwork'.
If I leave spaces out it works fine. I can enter the data direct into the
table without any problems.

I'm using Access 2002 and SQL Server 2000.

Thanks
Jason
 
With Rst
.Add (or .Edit)
!Address = "12345 doesntwork Way"
.Update
End With

If you are entering the new address into a textbox, use this:
!Address = Me!NameOfAddressTextbox
 
I don't think i was clear enough.

I'm adding/updating the data using a stored procedure in SQL Server, using
Access as the front end
Here is a snip of my code

rst.Open "procinsertnewemployee " & strlName & ", " & strfName _
& ", " & strAddress, con, adOpenDynamic, adLockOptimistic

If I don't leave spaces it works fine, as soon as there is a space involved
I get the error. the datatype for Address in the table is nvarchar

Jason
 
Back
Top