how to work around DataEnvironment Filter that includes an apostrophe?

M

Mike Scirocco

I'm using a DataEnvironment and trying to use a filter that includes an
apostrophe, e.g. if

cmbCustomer.text = "Dan's Auto Body Repair"

then this line generates an error:

DE.rsCommand2.Filter = "CustName='" & cmbCustomer.Text & "'"

Is there a workaround that will allow me to keep the apostrophes in the
database entries?

TIA,
Mike
 
M

Mike Scirocco

Mike said:
I'm using a DataEnvironment and trying to use a filter that includes an
apostrophe, e.g. if

cmbCustomer.text = "Dan's Auto Body Repair"

then this line generates an error:

DE.rsCommand2.Filter = "CustName='" & cmbCustomer.Text & "'"

Is there a workaround that will allow me to keep the apostrophes in the
database entries?

TIA,
Mike

Found it in another newsgroup:

SELECT * FROM 'cars.sold' where seller='" &
Replace(txtSellername.text,"'","''") & "'"

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top