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:
>Hiya.
>
>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.
>
>DROP DATABASE cd2;
>CREATE DATABASE if not exists cd2;
>USE cd2;
>
>
>select 'tblAction';
>CREATE TABLE if not exists tblAction (
>	Action#		INT AUTO_INCREMENT NOT NULL,
>	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
>http://www.mysql.com/doc/en/Legal_names.html to delimit the field name.  This
>doesn't seem to work.
>
>Can anyone help please.
>
>Thanks.
>
>-- Russell Curgenven
>-- System Administrator
>-- Community Recycling Network
>-- +44 (0)117 942 0142
>-- www.crn.org.uk



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.
Thread
# character problem in field namesruss7 Jan
  • Re: # character problem in field namesPaul DuBois7 Jan
Re: # character problem in field namesruss7 Jan