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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing Delimeter Not Found rte 2147217900

Status
Not open for further replies.

topone

Programmer
Jul 28, 2004
21
0
0
GB
Hello,
I am using VB 6.0 to access an Access 2000 db.
The problem is when I run the program this RTE comes up.
"-2147217900 (80040e14) closing Delimetr not found ...".
I know what is causing the problem but do not know how to avoid it.
some fields of the data contain the character "'". I know that in SQL is used to delimeter a string but in the db I have Surnames that contain it and also prescriptions that do have it to like "Athlete's foot", etc.
What can i Do?
Thanks
Paolo
 
You should use ADO Parameter objects to pass values to your query.

See the post by hmckillop in thread709-884241 for how to do this.

You will probably come across someone saying to use the Replace function to double-up any single-quotes in your data (O'Reilly becomes O''Reilly), but you should not do this, as it leaves you open to a SQL Injection attack.

Chip H.

____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Great Chiph,
I've also found that it works if you use the following:
SQL = "SELECT * FROM Formulary where condition=" & Chr$(34) & condname & Chr$(34)
rst.Open SQL, dbc, adOpenStatic, adLockOptimistic, adCmdText.
Thanks
Paolo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top