Solved

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

Posted on 2010-11-30
2
1,345 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:
jmatix earned 500 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

803 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