List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 7 2003 5:14pm
Subject:Re: # character problem in field names
View as plain text  
At 14:28 +0000 1/7/03, russ@stripped wrote:
>I have inherited an Access database whose originator has used the # 
>character in
>field names as you can see below.  I would like to replace this with 
>a MySQL served
>version.  This is part of the script created by ACCESSDump.
>CREATE DATABASE if not exists cd2;
>USE cd2;
>select 'tblAction';
>CREATE TABLE if not exists tblAction (
>	lngActionName		INT,
>	DefaultPriority		INT,
>	UserPriority		INT,
>	SumRecs		INT,
>	LastAutoexecItemDate		DATETIME,
>	LastAutoexecDate		DATETIME,
>	DayNum		INT,
>	INDEX lngActionName ( lngActionName ),
>	PRIMARY KEY ( Action# )
>INSERT INTO tblAction VALUES('34','1','1','0','0','','','3');
>INSERT INTO tblAction VALUES('35','2','2','0','0','','','3');
>My problem is that MySQL treats # as a comment delimiter 'till the 
>end of the line' and
>hence the script bombs after the line containing it.  I could change 
># to something
>safe like _, but unfortunately, and at the moment, we are still 
>having to use an Access
>front end.  This is very substantial, complicated and has almost 
>every form, query,
>report, module and macro using the # character.
>I have tried to use the ` character as mentioned at
> to delimit the field name.  This
>doesn't seem to work.
>Can anyone help please.
>-- Russell Curgenven
>-- System Administrator
>-- Community Recycling Network
>-- +44 (0)117 942 0142

Are you issuing these queries from within the mysql client?  # should
be legal within `-quoted names, but the mysql parser isn't quite the
same as the one used by the server, and # in names confuses it, even
if they are quoted.
# character problem in field namesruss7 Jan
  • Re: # character problem in field namesPaul DuBois7 Jan
Re: # character problem in field namesruss7 Jan