Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation error

Status
Not open for further replies.

vasah20

Programmer
Feb 16, 2001
559
US
How come I can't execute the following query through an ADODB.Connection, but I have no problem when I cut and paste it into a query?

This is the error I get:
One or more values are prohibited by the validation rule 'Like "???###"' set for 'engagement.Client ID'. Enter a value that the expression for this field can accept.

I have a validation rule on [Client ID], 'Like "???###"' (not surprisingly).

Code:
UPDATE engagement SET [Client ID] = 'tor400', [Job Date] = #2002-06-02 17:15:00 #, [Start Time] = #2002-06-02 17:15:00 #, [Contact Date] = #2000-12-05 00:00:00 #, [Confirmed Date] = #2000-12-07 00:00:00 #, [Price] = 4650 , [Deposit] = 4650 , [Payroll] = 0 , [Profit] = 2075 , [Job Location] = 'Embassy Suites Hotel ', [Room] = '123456',[Street Address] = '1939 N. Main Rd. ', [City] = 'Schaumburg ', [State] = 'il ', [Zip Code] = '60173 ', [Job Phone] = '123456789 ', [Job Type] = 'Wedding ', [Number of Guests] = 150 , [For] = ' ', [Sound System] = 'Yes ', [Keyboard] = '? ', [Stands/Lights] = 'Tuxedo ', [Special Instructions] = 'text text text', [FirstMailing] = ' ', [FollowUpOne] = ' ', [FollowUpTwo] = ' ', [FollowUpThree] = ' ', [BalanceDue] = 0 , [VenueContact] = 'E.C. Csas' WHERE [Job ID] = 206

The offending line of code looks like:
Code:
cn.execute sql_statement_from_above

thanks for any input...
leo
 
Hi vasah20!

i m not sure but try to divide the statement like this:

SQL = "UPDATE engagement SET [Client ID] = 'tor400', [Job Date] = #2002-06-02 17:15:00 #, "

SQL = SQL & "[Start Time] = #2002-06-02 17:15:00 #, [Contact Date] = #2000-12-05 00:00:00 #, [Confirmed Date] = #2000-12-07 00:00:00 #, [Price] = 4650 , [Deposit] = 4650 ,"

AND SO ON...

good luck
poky
 
Tried it, and I still get the same error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top