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

problems in inserting values on fields with question mark character

Status
Not open for further replies.

freiddann

MIS
Sep 9, 2003
2
PH
Hi!

Can somebody help me on how am I going to insert values in with question mark character chr(63) in fields...
Im using ADO in VB and MySQL

I cannot execute this statement with ADODB command:

strSQL = "insert into TableName (Field1) Values ('?')"
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = conn
.CommandType = adCmdText
.CommandText = strSQL
.Execute , , adCmdText
End With

Thanks...
 
strSQL = "insert into TableName (Field1) Values ('\?')"

that should solve your problem. Although I am not sure you need to escape question marks at all.

To escape reserved characters in MySQL, for example ' or " all you do, you insert your string normally enclosed by ' and you hit a backslash \ before any reserved sign


to insert o'connor you would

insert into table value 'o\'connor'

Bye

Qatqat


Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top