Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

[Microsoft][ODBC Microsoft Access Driver] Invalid bracketing of name

Posted on 2010-11-30
2
Medium Priority
?
1,580 Views
Last Modified: 2012-06-21
I have built the INSERT statement below using PERL. If I use a MS/Access Query and paste the SQL the statement it inserts a new row in the DB. However when I try to run it inside of perl with Roth's $db->Sql($sql) statement I am receiving the error:

---------- Error Report: ----------
Errors for "12" on connection 2:
Connection Number: 2
Error number: -1002
Error message: "[Microsoft][ODBC Microsoft Access Driver] Invalid bracketing of name '[4.5]'."
-----------------------------------

INSERT INTO Pictures
 (
AE_Setting,
AEB_Bracket_Value,
AF_Area_Heights,
AF_Area_Widths,
AF_Area_X_Positions,
AF_Area_Y_Positions,
AF_Image_Height,
AF_Image_Width,
AF_Mode,
AF_Point,
AF_Points_In_Focus,
Aperture,
Aperture_Value,
Auto_Exposure_Bracketing,
Auto_ISO,
Auto_Rotate,
Base_ISO,
Bits_Per_Sample,
Bulb_Duration,
Camera_ISO,
Camera_Model_Name,
Camera_Type,
Canon_Exposure_Mode,
Canon_Firmware_Version,
Canon_Flash_Mode,
Canon_Image_Height,
Canon_Image_Size,
Canon_Image_Type,
Canon_Image_Width,
Canon_Model_ID,
Categories,
Circle_Of_Confusion,
Color_Components,
Color_Space,
Components_Configuration,
Compressed_Bits_Per_Pixel,
Compression,
Continuous_Drive,
Contrast,
Control_Mode,
Create_Date,
Custom_Rendered,
Date_Stamp_Mode,
DateTime_Original,
Digital_Zoom,
Digital_Zoom_Ratio,
Directory,
Drive_Mode,
Easy_Mode,
Encoding_Process,
Exif_Byte_Order,
Exif_Image_Height,
Exif_Image_Width,
Exif_Version,
ExifTool_Version_Number,
Exposure_Compensation,
Exposure_Mode,
Exposure_Time,
F_Number,
Field_Of_View,
File_Modification_DateTime,
File_Name,
File_Number,
File_Size,
File_Source,
File_Type,
Firmware_Revision,
Flash,
Flash_Bits,
Flash_Exposure_Compensation,
Flash_Guide_Number,
Flash_Output,
Flashpix_Version,
Focal_Length,
Focal_Plane_Resolution_Unit,
Focal_Plane_X_Resolution,
Focal_Plane_X_Size,
Focal_Plane_Y_Resolution,
Focal_Plane_Y_Size,
Focal_Type,
Focal_Units,
Focus_Continuous,
Focus_Distance_Lower,
Focus_Distance_Upper,
Focus_Mode,
Focus_Range,
GPS_Latitude,
GPS_Latitude_Ref,
GPS_Longitude,
GPS_Longitude_Ref,
GPS_Map_Datum,
GPS_Measure_Mode,
GPS_Position,
GPS_Version_ID,
Hyperfocal_Distance,
Image_Description,
Image_Height,
Image_Size,
Image_Stabilization,
Image_Width,
Interoperability_Index,
Interoperability_Version,
ISO,
Lens,
Lens_ID,
Lens_Type,
Light_Value,
Long_Focal,
Macro_Mode,
Make,
Manual_Flash_Output,
Max_Aperture,
Max_Aperture_Value,
Measured_EV,
Metering_Mode,
MIME_Type,
Min_Aperture,
Modify_Date,
My_Color_Mode,
ND_Filter,
Num_AF_Points,
Optical_Zoom_Code,
Orientation,
Owner_Name,
Primary_AF_Point,
Quality,
Rating,
Record_Mode,
Related_Image_Height,
Related_Image_Width,
Resolution_Unit,
Saturation,
Scale_Factor_To_35_mm_Equivalent,
Scene_Capture_Type,
Self_Timer,
Self_Timer_2,
Sensing_Method,
Sharpness,
Shooting_Mode,
Short_Focal,
Shot_Number_In_Continuous_Burst,
Shutter_Speed,
Shutter_Speed_Value,
Slow_Shutter,
Spot_Metering_Mode,
Target_Aperture,
Target_Exposure_Time,
Thumbnail_Image,
Thumbnail_Image_Valid_Area,
Thumbnail_Length,
Thumbnail_Offset,
User_Comment,
Valid_AF_Points,
VRD_Offset,
White_Balance,
X_Resolution,
Y_Cb_Cr_Positioning,
Y_Cb_Cr_Sub_Sampling,
Y_Resolution,
Zoom_Source_Width,
Zoom_Target_Width
)
 VALUES
 (
"Normal AE",
"0",
"18 0 24576 0 866 0 0 8 0",
"18 53 -127 53 -127 0 -125 0 -115",
"0 6 8 53 -127 0 -125 0 -91",
"0 0 24576 0 1002 0 0 0 0",
"100",
"100",
"Single-point AF",
"Face Detect",
"0",
"4.5",
"4.5",
"Off",
"400",
"None",
"100",
"8",
"0",
"Auto",
"Canon PowerShot SX210 IS",
"Compact",
"Easy",
"Firmware Version 1.00",
"Off",
"3240",
"Large",
"IMG:PowerShot SX210 IS JPEG",
"4320",
"Unknown (0x2870000)",
"People",
"0.005 mm",
"3",
"sRGB",
"YCbCr",
"3",
"JPEG (old-style)",
"Single",
"Normal",
"Camera Local Control",
"11/13/2010 14:35:15",
"Normal",
"Off",
"11/13/2010 14:35:15",
"None",
"1",
"P:/Pictures/2010_11_13",
"Single-frame shooting",
"Kids & Pets",
"Baseline DCT, Huffman coding",
"Little-endian (Intel, II)",
"3240",
"4320",
"0221",
"7.69",
"0",
"Auto",
"1/50",
"4.5",
"27.8 deg",
"11/14/2010 07:12:54",
"IMG_0760.JPG",
"129-0760",
"3.3 MB",
"Digital Camera",
"JPEG",
"1.00 rev 3.00",
"Off",
"(none)",
"0",
"0",
"0",
"0100",
"13.3 mm (35 mm equivalent: 72.6 mm)",
"inches",
"17777.77778",
"6.32 mm",
"17802.1978",
"4.75 mm",
"Zoom",
"100",
"Single",
"0",
"1.32",
"Single",
"Auto",
"28.3550333333333",
"North",
"-81.5905083333333",
"West",
"WGS-84",
"2-Dimensional Measurement",
"28.3550333333333, -81.5905083333333",
"2.2.0.0",
"7.13 m",
"",
"3240",
"4320x3240",
"On",
"4320",
"R98 - DCF basic file (sRGB)",
"0100",
"400",
"5.0 - 70.0 mm (35 mm equivalent: 27.4 - 382.9 mm)",
"Unknown 5-70mm",
"Unknown (-1)",
"8.0",
"70 mm",
"Normal",
"Canon",
"n/a",
"4.5",
"4.5",
"3.84",
"Evaluative",
"image/jpeg",
"8",
"11/13/2010 14:35:15",
"Off",
"Off",
"9",
"49",
"Horizontal (normal)",
"",
"0",
"Fine",
"0",
"JPEG",
"3240",
"4320",
"inches",
"Normal",
"5.5",
"Portrait",
"Off",
"0",
"One-chip color area",
"0",
"Kids & Pets",
"5 mm",
"0",
"1/50",
"1/50",
"Off",
"Center",
"4.5",
"1/50",
"(Binary data 8192 bytes, use -b option to extract)",
"0 0 0 0",
"8192",
"3662",
"",
"1",
"0",
"Auto",
"180",
"Co-sited",
"YCbCr4:2:2 (2 1)",
"180",
"4320",
"4320"
)
0
Comment
Question by:jchauncey60
2 Comments
 
LVL 16

Accepted Solution

by:
Justin Mathews earned 2000 total points
ID: 34239339
Access is confused about the dot (.) in 4.5. Enclosing the values in single quotes would solve the problem as:


my $sql = <<'EOS';
INSERT INTO Pictures
 (
AE_Setting, 
AEB_Bracket_Value, 
AF_Area_Heights, 
AF_Area_Widths, 
AF_Area_X_Positions, 
AF_Area_Y_Positions, 
AF_Image_Height, 
AF_Image_Width, 
AF_Mode, 
AF_Point, 
AF_Points_In_Focus, 
Aperture, 
Aperture_Value, 
Auto_Exposure_Bracketing, 
Auto_ISO, 
Auto_Rotate, 
Base_ISO, 
Bits_Per_Sample, 
Bulb_Duration, 
Camera_ISO, 
Camera_Model_Name, 
Camera_Type, 
Canon_Exposure_Mode, 
Canon_Firmware_Version, 
Canon_Flash_Mode, 
Canon_Image_Height, 
Canon_Image_Size, 
Canon_Image_Type, 
Canon_Image_Width, 
Canon_Model_ID, 
Categories, 
Circle_Of_Confusion, 
Color_Components, 
Color_Space, 
Components_Configuration, 
Compressed_Bits_Per_Pixel, 
Compression, 
Continuous_Drive, 
Contrast, 
Control_Mode, 
Create_Date, 
Custom_Rendered, 
Date_Stamp_Mode, 
DateTime_Original, 
Digital_Zoom, 
Digital_Zoom_Ratio, 
Directory, 
Drive_Mode, 
Easy_Mode, 
Encoding_Process, 
Exif_Byte_Order, 
Exif_Image_Height, 
Exif_Image_Width, 
Exif_Version, 
ExifTool_Version_Number, 
Exposure_Compensation, 
Exposure_Mode, 
Exposure_Time, 
F_Number, 
Field_Of_View, 
File_Modification_DateTime, 
File_Name, 
File_Number, 
File_Size, 
File_Source, 
File_Type, 
Firmware_Revision, 
Flash, 
Flash_Bits, 
Flash_Exposure_Compensation, 
Flash_Guide_Number, 
Flash_Output, 
Flashpix_Version, 
Focal_Length, 
Focal_Plane_Resolution_Unit, 
Focal_Plane_X_Resolution, 
Focal_Plane_X_Size, 
Focal_Plane_Y_Resolution, 
Focal_Plane_Y_Size, 
Focal_Type, 
Focal_Units, 
Focus_Continuous, 
Focus_Distance_Lower, 
Focus_Distance_Upper, 
Focus_Mode, 
Focus_Range, 
GPS_Latitude, 
GPS_Latitude_Ref, 
GPS_Longitude, 
GPS_Longitude_Ref, 
GPS_Map_Datum, 
GPS_Measure_Mode, 
GPS_Position, 
GPS_Version_ID, 
Hyperfocal_Distance, 
Image_Description, 
Image_Height, 
Image_Size, 
Image_Stabilization, 
Image_Width, 
Interoperability_Index, 
Interoperability_Version, 
ISO, 
Lens, 
Lens_ID, 
Lens_Type, 
Light_Value, 
Long_Focal, 
Macro_Mode, 
Make, 
Manual_Flash_Output, 
Max_Aperture, 
Max_Aperture_Value, 
Measured_EV, 
Metering_Mode, 
MIME_Type, 
Min_Aperture, 
Modify_Date, 
My_Color_Mode, 
ND_Filter, 
Num_AF_Points, 
Optical_Zoom_Code, 
Orientation, 
Owner_Name, 
Primary_AF_Point, 
Quality, 
Rating, 
Record_Mode, 
Related_Image_Height, 
Related_Image_Width, 
Resolution_Unit, 
Saturation, 
Scale_Factor_To_35_mm_Equivalent, 
Scene_Capture_Type, 
Self_Timer, 
Self_Timer_2, 
Sensing_Method, 
Sharpness, 
Shooting_Mode, 
Short_Focal, 
Shot_Number_In_Continuous_Burst, 
Shutter_Speed, 
Shutter_Speed_Value, 
Slow_Shutter, 
Spot_Metering_Mode, 
Target_Aperture, 
Target_Exposure_Time, 
Thumbnail_Image, 
Thumbnail_Image_Valid_Area, 
Thumbnail_Length, 
Thumbnail_Offset, 
User_Comment, 
Valid_AF_Points, 
VRD_Offset, 
White_Balance, 
X_Resolution, 
Y_Cb_Cr_Positioning, 
Y_Cb_Cr_Sub_Sampling, 
Y_Resolution, 
Zoom_Source_Width, 
Zoom_Target_Width
)
 VALUES
 (
'Normal AE', 
'0', 
'18 0 24576 0 866 0 0 8 0', 
'18 53 -127 53 -127 0 -125 0 -115', 
'0 6 8 53 -127 0 -125 0 -91', 
'0 0 24576 0 1002 0 0 0 0', 
'100', 
'100', 
'Single-point AF', 
'Face Detect', 
'0', 
'4.5', 
'4.5', 
'Off', 
'400', 
'None', 
'100', 
'8', 
'0', 
'Auto', 
'Canon PowerShot SX210 IS', 
'Compact', 
'Easy', 
'Firmware Version 1.00', 
'Off', 
'3240', 
'Large', 
'IMG:PowerShot SX210 IS JPEG', 
'4320', 
'Unknown (0x2870000)', 
'People', 
'0.005 mm', 
'3', 
'sRGB', 
'YCbCr', 
'3', 
'JPEG (old-style)', 
'Single', 
'Normal', 
'Camera Local Control', 
'11/13/2010 14:35:15', 
'Normal', 
'Off', 
'11/13/2010 14:35:15', 
'None', 
'1', 
'P:/Pictures/2010_11_13', 
'Single-frame shooting', 
'Kids & Pets', 
'Baseline DCT, Huffman coding', 
'Little-endian (Intel, II)', 
'3240', 
'4320', 
'0221', 
'7.69', 
'0', 
'Auto', 
'1/50', 
'4.5', 
'27.8 deg', 
'11/14/2010 07:12:54', 
'IMG_0760.JPG', 
'129-0760', 
'3.3 MB', 
'Digital Camera', 
'JPEG', 
'1.00 rev 3.00', 
'Off', 
'(none)', 
'0', 
'0', 
'0', 
'0100', 
'13.3 mm (35 mm equivalent: 72.6 mm)', 
'inches', 
'17777.77778', 
'6.32 mm', 
'17802.1978', 
'4.75 mm', 
'Zoom', 
'100', 
'Single', 
'0', 
'1.32', 
'Single', 
'Auto', 
'28.3550333333333', 
'North', 
'-81.5905083333333', 
'West', 
'WGS-84', 
'2-Dimensional Measurement', 
'28.3550333333333, -81.5905083333333', 
'2.2.0.0', 
'7.13 m', 
'', 
'3240', 
'4320x3240', 
'On', 
'4320', 
'R98 - DCF basic file (sRGB)', 
'0100', 
'400', 
'5.0 - 70.0 mm (35 mm equivalent: 27.4 - 382.9 mm)', 
'Unknown 5-70mm', 
'Unknown (-1)', 
'8.0', 
'70 mm', 
'Normal', 
'Canon', 
'n/a', 
'4.5', 
'4.5', 
'3.84', 
'Evaluative', 
'image/jpeg', 
'8', 
'11/13/2010 14:35:15', 
'Off', 
'Off', 
'9', 
'49', 
'Horizontal (normal)', 
'', 
'0', 
'Fine', 
'0', 
'JPEG', 
'3240', 
'4320', 
'inches', 
'Normal', 
'5.5', 
'Portrait', 
'Off', 
'0', 
'One-chip color area', 
'0', 
'Kids & Pets', 
'5 mm', 
'0', 
'1/50', 
'1/50', 
'Off', 
'Center', 
'4.5', 
'1/50', 
'(Binary data 8192 bytes, use -b option to extract)', 
'0 0 0 0', 
'8192', 
'3662', 
'', 
'1', 
'0', 
'Auto', 
'180', 
'Co-sited', 
'YCbCr4:2:2 (2 1)', 
'180', 
'4320', 
'4320'
)

EOS
!$db->Sql($sql) or die "couldn't do $query because ", $db->Error(), "\n";

Open in new window

0
 

Author Closing Comment

by:jchauncey60
ID: 34240033
Grrrr....Microsoft, the product that everyone loves to hate! I tried every combination other than your solution, which worked. I escaped the single quotes and off it went.

Thanks so very much!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question