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!

Slash Char in Field Name SQL Select

Status
Not open for further replies.

cleith

Programmer
Sep 27, 2002
22
Hi,

Has anyone had this problem. This query works in Access 2000 but fails with ADO in VB6. Doesn't like the '/' in the field name.

Is there a way to escape the '/'. Select * works fine, returns all fields.


Driver is 3.00.00

Thanks,

Charles


Dim i%, tSQL$

tSQL = "SELECT WorkOrder, [S/OCustNumber] FROM WO1_WorkOrderMaster" ' WHERE (((WO1_WorkOrderMaster.WorkOrder)='W73380'))"

cn.Open "Driver={MAS 90 32-Bit ODBC Driver};Directory=f:\MAS90\;UID=UID;PWD=PWD;Company=ABC"

rs.Open tSQL, cn

 
I don't know if this is the solution but you might want to try a backslash before the slash so the slash (S\/OC...)will be treated as a literal.

George
 
Charles,

I have now run into the same problem and have got
around it. If you still have not solved it here is
my solution I used with Perl. I put double quotes
around the column name. This is Perl syntax.

$SQl = "select \"S/OCustNumber\" from FROM WO1_WorkOrderMaster";

I was able to get the output I wanted after doing the
above. I had to escape the 2 double quotes so that the
string would be kept in tact. If you haven't already
solved this problem, I hope this helps.

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top